Age | Commit message (Collapse) | Author |
|
mkconfig: Map `includedir` only for system ruby
Only when installing to the system path on macOS, prepend '$(SDKROOT)'
and remap `includedir`.
Fix https://github.com/rbenv/ruby-build/discussions/2123
---
test/mkmf/test_config.rb | 4 ++--
test/test_rbconfig.rb | 9 ---------
tool/mkconfig.rb | 4 +++-
3 files changed, 5 insertions(+), 12 deletions(-)
|
|
[Bug #19399] Parsing invalid heredoc inside block parameter
Although this is of course invalid as Ruby code, allow to just parse
and tokenize.
---
ext/ripper/lib/ripper/lexer.rb | 2 +-
test/ripper/test_lexer.rb | 12 ++++++++++++
2 files changed, 13 insertions(+), 1 deletion(-)
|
|
[Bug #19398] Memory leak in WeakMap
There's a memory leak in ObjectSpace::WeakMap due to not freeing
the `struct weakmap`. It can be seen in the following script:
```
100.times do
10000.times do
ObjectSpace::WeakMap.new
end
# Output the Resident Set Size (memory usage, in KB) of the current Ruby process
puts `ps -o rss= -p #{$$}`
end
```
---
gc.c | 1 +
test/ruby/test_weakmap.rb | 9 +++++++++
2 files changed, 10 insertions(+)
|
|
Merge RubyGems-3.4.6 and Bundler-2.4.6
|
|
Fix parsing of regexps that toggle extended mode on/off inside regexp
This was broken in ec3542229b29ec93062e9d90e877ea29d3c19472. That commit
didn't handle cases where extended mode was turned on/off inside the
regexp. There are two ways to turn extended mode on/off:
```
/(?-x:#y)#z
/x =~ '#y'
/(?-x)#y(?x)#z
/x =~ '#y'
```
These can be nested inside the same regexp:
```
/(?-x:(?x)#x
(?-x)#y)#z
/x =~ '#y'
```
As you can probably imagine, this makes handling these regexps
somewhat complex. Due to the nesting inside portions of regexps,
the unassign_nonascii function needs to be recursive. In
recursive mode, it needs to track both opening and closing
parentheses, similar to how it already tracked opening and
closing brackets for character classes.
When scanning the regexp and coming to `(?` not followed by `#`,
scan for options, and use `x` and `i` to determine whether to
turn on or off extended mode. For `:`, indicting only the
current regexp section should have the extended mode
switched, recurse with the extended mode set or unset. For `)`,
indicating the remainder of the regexp (or current regexp portion
if already recursing) should turn extended mode on or off, just
change the extended mode flag and keep scanning.
While testing this, I noticed that `a`, `d`, and `u` are accepted
as options, in addition to `i`, `m`, and `x`, but I can't see
where those options are documented. I'm not sure whether or not
handling `a`, `d`, and `u` as options is a bug.
Fixes [Bug #19379]
---
re.c | 153 +++++++++++++++++++++++++++++++++++++----------
test/ruby/test_regexp.rb | 56 +++++++++++++++++
2 files changed, 176 insertions(+), 33 deletions(-)
|
|
bignum.c: rb_int_parse_cstr handle `0` strings
[Bug #19390]
We shouldn't check the string length when skipping zeros, as the
string might only contains zero characters, resulting in an empty string.
---
bignum.c | 1 -
test/ruby/test_time.rb | 4 ++++
2 files changed, 4 insertions(+), 1 deletion(-)
|
|
[ruby/stringio] [Bug #19389] Fix chomping with longer separator
https://github.com/ruby/stringio/commit/eb322a9716
---
ext/stringio/stringio.c | 5 +++--
test/stringio/test_stringio.rb | 2 ++
2 files changed, 5 insertions(+), 2 deletions(-)
|
|
[Bug #19350]
* Merge RubyGems-3.4.2 and Bundler-2.4.2
* Merge RubyGems-3.4.3 and Bundler-2.4.3
* Generate parser-text.rb of racc when sync it
* Ignore LICENSE files of libraries vendored in rubygems [ci skip]
* Adjust spec of bundler like as `sync_default_gems` [ci skip]
* Fixed a typo
* Removed vendored LICENSE file.
* Update LEGAL sections for pub_grub
* Merge RubyGems-3.4.4 and Bundler-2.4.4
* Merge RubyGems-3.4.5 and Bundler-2.4.5
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
|
2c93c554019ebdc394d3c51c6d925620d3005f84,f5ea43a2e61789357e9c4b374b4bc6756abeae17: [Backport #19360]
Ensure main file has default coverage if required. (#7169)
* Extract common code for coverage setup.
---
iseq.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
More coverage tests & specs. (#7171)
* Add spec for eval and line coverage.
* Add test for main file coverage.
---
spec/ruby/library/coverage/start_spec.rb | 8 +++++++-
test/coverage/autostart.rb | 2 ++
test/coverage/main.rb | 1 +
test/coverage/test_coverage.rb | 7 +++++++
4 files changed, 17 insertions(+), 1 deletion(-)
create mode 100644 test/coverage/autostart.rb
create mode 100644 test/coverage/main.rb
|
|
Fix crash when defining ivars on special constants
[Bug #19339]
---
test/ruby/test_variable.rb | 6 ++++++
vm_insnhelper.c | 5 +++++
2 files changed, 11 insertions(+)
|
|
String#bytesplice should return self
In Feature #19314, we concluded that the return value of String#bytesplice
should be changed from the source string to the receiver, because the source
string is useless and confusing when extra arguments are added.
This change should be included in Ruby 3.2.1.
---
string.c | 4 ++--
test/ruby/test_string.rb | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
|
|
Fix re-embedding of strings during compaction
The reference updating code for strings is not re-embedding strings
because the code is incorrectly wrapped inside of a
`if (STR_SHARED_P(obj))` clause. Shared strings can't be re-embedded
so this ends up being a no-op. This means that strings can be moved to a
large size pool during compaction, but won't be re-embedded, which would
waste the space.
---
gc.c | 16 +++++++++-------
string.c | 12 ++++++++----
test/ruby/test_gc_compact.rb | 8 ++++----
3 files changed, 21 insertions(+), 15 deletions(-)
|
|
The test added in 90a80eb0 fails if Ruby is verbose, it outputs the
following line to stderr:
RUBY_GC_HEAP_INIT_SLOTS=100 (default value: 10000)
|
|
Check if the argument is Thread::Backtrace::Location object
[Bug #19262]
---
ast.c | 5 +++++
test/ruby/test_ast.rb | 6 ++++++
2 files changed, 11 insertions(+)
|
|
Fix crash in TracePoint c_call for removed method
trace_arg->id is the ID of the original method of an aliased method. If
the original method is removed, then the lookup will fail. We should use
trace_arg->called_id instead, which is the ID of the aliased method.
Fixes [Bug #19305]
---
test/ruby/test_settracefunc.rb | 23 +++++++++++++++++++++++
vm_trace.c | 2 +-
2 files changed, 24 insertions(+), 1 deletion(-)
|
|
YJIT: Save PC and SP before calling leaf builtins (#7090)
Previously, we did not update `cfp->sp` before calling the C function of
ISEQs marked with `Primitive.attr! "inline"` (leaf builtins). This
caused the GC to miss temporary values on the stack in case the function
allocates and triggers a GC run. Right now, there is only a few leaf
builtins in numeric.rb on Integer methods such as `Integer#~`. Since
these methods only allocate when operating on big numbers, we missed
this issue.
Fix by saving PC and SP before calling the functions -- our usual
protocol for calling C functions that may allocate on the GC heap.
[Bug #19316]
---
test/ruby/test_yjit.rb | 16 ++++++++++++++++
yjit/src/codegen.rs | 4 ++++
2 files changed, 20 insertions(+)
|
|
YJIT: Fix `yield` into block with >=30 locals on ARM
It's a register spill issue. Fix by moving the Qnil fill snippet to
after registers are released.
[Bug #19299]
---
test/ruby/test_yjit.rb | 14 ++++++++++++++
yjit/src/codegen.rs | 29 ++++++++++++++---------------
2 files changed, 28 insertions(+), 15 deletions(-)
|
|
291a4098cf649c027cb50c16b872455f26ad1dfb,5be0d42d2c4dc765230c76738289560f9ee37f09: [Backport #19296]
Add missing assertion
---
test/ruby/test_time.rb | 3 +++
1 file changed, 3 insertions(+)
[Bug #19296] Precheck bits of time components
---
test/ruby/test_time.rb | 15 +++++++++++++++
time.c | 14 ++++++++------
2 files changed, 23 insertions(+), 6 deletions(-)
|
|
[Bug #19292] Re-initialize tm when wday or yday is not set
---
test/ruby/test_time.rb | 3 ++-
time.c | 31 ++++++++++++++++++++++---------
2 files changed, 24 insertions(+), 10 deletions(-)
|
|
Fix integer underflow when using HEAP_INIT_SLOTS
There is an integer underflow when the environment variable
RUBY_GC_HEAP_INIT_SLOTS is less than the number of slots currently
in the Ruby heap.
[Bug #19284]
---
gc.c | 25 +++++++++++++------------
test/ruby/test_gc.rb | 5 +++++
2 files changed, 18 insertions(+), 12 deletions(-)
|
|
Fix [Bug 19273], set correct value to `outer_repeat` on `OP_REPEAT`
(#7035)
---
regexec.c | 2 +-
test/ruby/test_regexp.rb | 5 +++++
2 files changed, 6 insertions(+), 1 deletion(-)
|
|
MJIT: Fix JIT code for multiple values in a single case
[Bug #19263]
---
lib/ruby_vm/mjit/compiler.rb | 2 +-
test/ruby/test_mjit.rb | 10 ++++++++++
2 files changed, 11 insertions(+), 1 deletion(-)
|
|
|
|
|
|
I noticed this while running test_yjit with --mjit-call-threshold=1,
which redefines `Integer#<`. When Ruby is monkey-patched,
MJIT itself could be broken.
Similarly, Ruby scripts could break MJIT in many different ways. I
prepared the same set of hooks as YJIT so that we could possibly
override it and disable it on those moments. Every constant under
RubyVM::MJIT is private and thus it's an unsupported behavior though.
Notes:
Merged-By: k0kubun <takashikkbn@gmail.com>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6987
|
|
|
|
`pwrite`. (#7012)
Notes:
Merged-By: ioquatix <samuel@codeotaku.com>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/7014
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/7013
|
|
Frozen arrays should not move from heap allocated to embedded because
frozen arrays could be shared roots for other (shared) arrays. If the
frozen array moves from heap allocated to embedded it would cause issues
since the shared array would no longer know where to set the pointer
in the shared root.
Notes:
Merged: https://github.com/ruby/ruby/pull/7013
|
|
When the temporary path is long enough, the formatter may fold the
path and may hit a hyphen at the end of line, and miscounted.
https://github.com/ruby/rdoc/commit/5f46479543
|
|
|
|
https://github.com/ruby/rdoc/commit/f067c174da
|
|
test_s_generate_parameters
The root cause has been fixed by OpenSSL 3.0.6, but Ubuntu 22.04's
OpenSSL package has not backported the patch yet.
Reference: https://github.com/ruby/openssl/issues/492
https://github.com/ruby/openssl/commit/f2e2a5e5ed
|
|
The behavior of EVP_PKEY_public_check changed between OpenSSL 1.1.1
and 3.0 so that it no longer validates the private key. Instead, private
keys can be validated through EVP_PKEY_private_check and
EVP_PKEY_pairwise_check.
[ky: simplified condition to use either EVP_PKEY_check() or
EVP_PKEY_public_check().]
https://github.com/ruby/openssl/commit/e38a63ab3d
|
|
https://github.com/ruby/openssl/commit/a3d230d4e0
|
|
As noted in commit https://github.com/ruby/openssl/commit/a2ed156cc9f1 ("test/test_ssl: do not run NPN tests
for LibreSSL >= 2.6.1", 2017-08-13), NPN is known not to work properly
on LibreSSL.
Disable NPN support on LibreSSL, whether OPENSSL_NO_NEXTPROTONEG is
defined or not.
NPN is less relevant today anyway. Let's also silence test suite when
it's not available.
https://github.com/ruby/openssl/commit/289f6e0e1f
|
|
LibreSSL versions
Commit https://github.com/ruby/openssl/commit/af895bc5596b ("asn1: avoid truncating OID in
OpenSSL::ASN1::ObjectId#oid", 2016-12-15) added this test case.
The OBJ_obj2txt() issue was fixed by LibreSSL 2.5.1 (released in 2017)
and is no longer relevant today.
https://github.com/ruby/openssl/commit/6a188f1a29
|
|
LibreSSL 3.6.0 expects the seconds part in UTCTime and GeneralizedTime
to be always present. LibreSSL 3.6.0 release note [1] says:
> - The ASN.1 time parser has been refactored and rewritten using CBS.
> It has been made stricter in that it now enforces the rules from
> RFC 5280.
[1] https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.6.0-relnotes.txt
https://github.com/ruby/openssl/commit/bbc540fe83
|
|
Notes:
Merged-By: k0kubun <takashikkbn@gmail.com>
|
|
argument
Previously, only certain values of the 3rd argument triggered a
deprecation warning.
First step for fix for bug #18797. Support for the 3rd argument
will be removed after the release of Ruby 3.2.
Fix minor fallout discovered by the tests.
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
Notes:
Merged: https://github.com/ruby/ruby/pull/6976
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6988
|
|
This makes sure the method returns nil for these events, as
described in NEWS, even if the TracePoint could create a binding.
Notes:
Merged: https://github.com/ruby/ruby/pull/6984
Merged-By: jeremyevans <code@jeremyevans.net>
|
|
Implements [Feature #19000]
This commit adds copy with changes functionality for `Data` objects
using a new method `Data#with`.
Since Data objects are immutable, the only way to change them is by
creating a copy. This PR adds a `with` method for `Data` class instances
that optionally takes keyword arguments.
If the `with` method is called with no arguments, the behaviour is the
same as the `Kernel#dup` method, i.e. a new shallow copy is created
with no field values changed.
However, if keyword arguments are supplied to the `with` method, then
the copy is created with the specified field values changed. For
example:
```ruby
Point = Data.define(:x, :y)
point = Point.new(x: 1, y: 2)
point.with(x: 3) # => #<data Point x: 3, y: 2>
```
Passing positional arguments to `with` or passing keyword arguments to
it that do not correspond to any of the members of the Data class will
raise an `ArgumentError`.
Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
Notes:
Merged-By: k0kubun <takashikkbn@gmail.com>
|
|
|
|
Inconsistency pointed out by @mame:
```
>> Enumerator.product([1], [2], [3]).to_a
=> [[1, 2, 3]]
>> Enumerator.product([1], [2]).to_a
=> [[1, 2]]
>> Enumerator.product([1]).to_a
=> [1]
>> Enumerator.product().to_a
=> [nil]
```
Got fixed as follows:
```
>> Enumerator.product([1], [2], [3]).to_a
=> [[1, 2, 3]]
>> Enumerator.product([1], [2]).to_a
=> [[1, 2]]
>> Enumerator.product([1]).to_a
=> [[1]]
>> Enumerator.product().to_a
=> [[]]
```
This was due to the nature of the N-argument funcall in Ruby.
|
|
|
|
https://github.com/ruby/optparse/commit/766f567405
|
|
`ruby` is not always available in certain build environments and
configure options. Choose appropriate command line using EnvUtil.
Notes:
Merged: https://github.com/ruby/ruby/pull/5417
|