92084 Commits

Author SHA1 Message Date
Jeremy Evans
0b07d2a1e3 Deprecate passing arguments to Set#to_set and Enumerable#to_set
Array#to_a, Hash#to_h, Enumerable#to_a, and Enumerable#to_h do not
allow you to specify subclasses.  This has undesired behavior when
passing non-Set subclasses.  All of these are currently allowed, and
none make sense:

```ruby
enum = [1,2,3].to_enum

enum.to_set(Hash)
enum.to_set(Struct.new("A", :a))
enum.to_set(ArgumentError)
enum.to_set(Thread){}
```

Users who want to create instances of a subclass of Set from an
enumerable should pass the enumerable to SetSubclass.new instead of
using to_set.
2025-06-06 01:24:05 +09:00
Étienne Barrié
2f80117ce4 Fix comment about debugging shapes
This method was moved to RubyVM::Shape in 913979bede2a1b79109fa2072352882560d55fe0.
2025-06-05 18:02:45 +02:00
Étienne Barrié
22dfa250a8 More comprehensive debugging configuration 2025-06-05 18:01:11 +02:00
Peter Zhu
da2453c58d Add debug message to test_heaps_grow_independently
To debug flaky failures on i686 that look like:

  1) Failure:
  TestGc#test_heaps_grow_independently [test/ruby/test_gc.rb:704]:
  Expected 2061929 to be < 2000000.
2025-06-05 10:51:46 -04:00
Alan Wu
01f6bd8bc3
ZJIT: Add insns param that tests for opcode presence 2025-06-05 14:45:42 +00:00
Nobuyoshi Nakada
998e5791c5 [ruby/date] Suppress warnings by gcc-13 with -Og
https://github.com/ruby/date/commit/6dd7969a64
2025-06-05 14:18:38 +00:00
Nobuyoshi Nakada
edaa27ce45
Suppress warnings by gcc-13 with -Og 2025-06-05 22:33:02 +09:00
Nobuyoshi Nakada
0e0008da0f
[Bug #21381] Refine error messages for it and numbered parameters 2025-06-05 19:21:02 +09:00
David Rodríguez
b9e3edb3e6 [rubygems/rubygems] Slightly simplify locked specification source replacement
https://github.com/rubygems/rubygems/commit/22f0a07377
2025-06-05 19:12:46 +09:00
David Rodríguez
970eac1530 [rubygems/rubygems] Fix git source unlocking for multi-gem repositories like Rails
If you have

```
gem "rails", git: "https://github.com/rails/rails"
```

and then explicitly pin to an older ref, like

```
gem "rails", git: "https://github.com/rails/rails", ref: "https://github.com/rubygems/rubygems/commit/99bacb5aa8e5"
```

Then `bundle install` fails, because locked sources fail to be updated
to use the new source.

This commit fixes the problem by making sure get their source properly
replaced.

https://github.com/rubygems/rubygems/commit/5de8c2e0cf
2025-06-05 19:12:46 +09:00
David Rodríguez
e4933e1d93 [rubygems/rubygems] Fix bundle update --bundler when restarts disabled
There's no reason why we should not update bundler as requested, even if
restarts are disabled.

https://github.com/rubygems/rubygems/commit/e59acd2a0d
2025-06-05 19:12:45 +09:00
David Rodríguez
5cf07c1e8f [rubygems/rubygems] Look in configured path when checking if self-update version is installed
https://github.com/rubygems/rubygems/commit/1ce0882e6f
2025-06-05 19:12:44 +09:00
David Rodríguez
1befc5d102 [rubygems/rubygems] Make update specs independent from version of Bundler
https://github.com/rubygems/rubygems/commit/609b21a5fe
2025-06-05 19:12:44 +09:00
David Rodríguez
0e6805eb31 [rubygems/rubygems] Refactor restarts to not need memoizing the restart version
https://github.com/rubygems/rubygems/commit/a9d80a7dcb
2025-06-05 19:12:43 +09:00
David Rodríguez
417210c0ec [rubygems/rubygems] Make self management specs independent from version of Bundler
https://github.com/rubygems/rubygems/commit/1257bd161e
2025-06-05 19:12:42 +09:00
David Rodríguez
523f68c6ab [rubygems/rubygems] Compare major version only
https://github.com/rubygems/rubygems/commit/6b4cf6713d
2025-06-05 19:12:42 +09:00
David Rodríguez
8b2145dc31 [rubygems/rubygems] Remove dead spec helpers
https://github.com/rubygems/rubygems/commit/ee5a0158fd
2025-06-05 19:12:41 +09:00
David Rodríguez
e74008bfc9 [rubygems/rubygems] Reduce duplication a bit
https://github.com/rubygems/rubygems/commit/0574c62fc0
2025-06-05 19:12:40 +09:00
Antoine Marguerie
11492bd88d [rubygems/rubygems] Fix headings levels in Changelogs
And adapt release scripts and configuration to the new structure.

https://github.com/rubygems/rubygems/commit/3deb1aedae
2025-06-05 19:12:39 +09:00
Nicholas La Roux
803dae70cb [rubygems/rubygems] Deprecate x64-mingw32 legacy Windows platform in favor of x64-mingw-ucrt
https://github.com/rubygems/rubygems/commit/71c969be44
2025-06-05 19:12:37 +09:00
David Rodríguez
21bce66f59 [rubygems/rubygems] Reset variables that can cause specs to fail if set
https://github.com/rubygems/rubygems/commit/8df67b7322
2025-06-05 19:12:36 +09:00
Nobuyoshi Nakada
9f112afcde
Allow volatile pointer relaxed atomic operations 2025-06-05 17:32:24 +09:00
Nobuyoshi Nakada
9e84a278a3
Win: Cast of qualifier in rbimpl_atomic_u64_load_relaxed 2025-06-05 17:09:52 +09:00
Nobuyoshi Nakada
8906d55cb5 [ruby/stringio] Extract internal part as the function
`str_chilled_p`
(https://github.com/ruby/stringio/pull/136)

https://github.com/ruby/stringio/commit/3c52ddc4c8
2025-06-05 08:06:51 +00:00
git
256440a827 Update bundled gems list as of 2025-06-05 2025-06-05 07:05:29 +00:00
Nobuyoshi Nakada
62b1ae0905
Win: Slim down vcvars_ver options in the matrix 2025-06-05 15:34:49 +09:00
Jean Boussier
772fc1f187 Get rid of rb_shape_t.flags
Now all flags are only in the `shape_id_t`, and can all be checked
without needing to dereference a pointer.
2025-06-05 07:44:44 +02:00
Stan Lo
111986f8b0
ZJIT: Add newrange support (#13505)
* Add newrange support to zjit

* Add RangeType enum for Range insn's flag

* Address other feedback
2025-06-04 18:51:53 -07:00
Koichi Sasada
0ca80484ac mark main Ractor object
`RUBY_DEBUG=gc_stress ./miniruby -e0` crashes because of this
marking miss.

BTW, to use `RUBY_DEBUG=gc_stress` we need to specify
`--enable-debug-env` configure option. This is why I couldn't repro
on my environments.

see c0c94ab183d0d428595ccb74ae71ee945f1afd45
2025-06-05 08:15:57 +09:00
Takashi Kokubun
112c34252d
ZJIT: Implement side exits for entry frames (#13469)
Co-authored-by: Max Bernstein <tekknolagi@gmail.com>
Co-authored-by: Alan Wu <alansi.xingwu@shopify.com>
2025-06-04 14:14:40 -07:00
Peter Zhu
99cc100cdf Remove dead rb_malloc_info_show_results 2025-06-04 14:07:19 -04:00
Daniel Colson
3b5787a97f Implement write barrier for addrinfo
`rb_addrinfo_t` has `VALUE inspectname` and `VALUE canonname`, so this
triggers the write barrier for those. The `AddrInfo` wasn't readily
available where we need to call `RB_OBJ_WRITE`, so this involves passing
`self` around a bit.
2025-06-04 10:18:36 -07:00
Naoto Ono
a4dc778a5e
Launchable: Set env variables to prevent CI slowdowns (#13513)
When Launchable in unstable, the round trip time takes a long time, which slows down CI execution. In this PR I configured the environment variable `LAUNCHABLE_COMMIT_TIMEOUT` to configure the timeout.

https://github.com/launchableinc/cli/pull/1015
2025-06-04 11:59:40 +00:00
Stan Lo
a87b089349
ZJIT: Fix incorrect method name in test for Array#size 2025-06-04 20:14:44 +09:00
Jean Boussier
675f33508c Get rid of TOO_COMPLEX shape type
Instead it's now a `shape_id` flag.

This allows to check if an object is complex without having
to chase the `rb_shape_t` pointer.
2025-06-04 13:13:50 +02:00
Yusuke Endoh
8d49c05c13 Use the edge version of debug gem 2025-06-04 19:53:16 +09:00
Yusuke Endoh
caa6ba1a46 Make rb_debug_inspector_backtrace_locations return a raw backtrace
Previously, a user of the debug inspector API was supposed to use
`rb_debug_inspector_backtrace_locations` to get an array of
`Thread::Backtrace::Location`, and then used its index to get more
information from `rb_debug_inspector _frame_binding_get(index)`, etc.

However, `rb_debug_inspector_backtrace_locations` returned an array of
backtraces excluding rescue/ensure frames. On the other hand,
`rb_debug_inspector_frame_binding_get(index)` interprets index with
rescue/ensure frames. This led to inconsistency of the index, and it was
very difficult to correctly use the debug inspector API.

This is a minimal fix for the issue by making
`rb_debug_inspector_backtrace_locations` return a raw backtrace
including rescue/ensure frames.
2025-06-04 19:53:16 +09:00
Alan Wu
8d14d6ea2d ZJIT: Spill to the stack using arguments instead of FrameState
The FrameState on the SendWithoutBlock represents the entry state,
but for instructions that push to the stack in the middle of the
instruction before actually doing the send like opt_aref_with,
the FrameState is incorrect. We need to write to the stack using the
arguments for the instruction.
2025-06-04 06:23:30 -04:00
Alan Wu
6f0f84e5dd ZJIT: Parse opt_aref_with into HIR 2025-06-04 06:23:30 -04:00
Koichi Sasada
8070d5d97d Ractor#take and warn
`Ractor#take` was deprecated but some libraries can use it as
an alias for `Ractor#value` (i.e., to wait for a Ractor's
temrination and retrieve its result).
Therefore `Ractor#take` is simply an alias for `Ractor#value`.

This method will remain available until the end of August 2025,
unless there is further discussion.
2025-06-04 19:18:16 +09:00
Nobuyoshi Nakada
9fddb8d954
Suppress dangling pointer warning by gcc
`__has_warning` is clang, not gcc.
2025-06-04 15:31:40 +09:00
Nobuyoshi Nakada
7ddc5e6187
Suppress overflow warning at ALLOC_N in iseq_set_local_table
`xmalloc2` checks the overflow of arguments multiplication.
2025-06-04 15:31:40 +09:00
Nobuyoshi Nakada
c5f7d274d7
Check for 64bit atomic operations
May not be supported on some 32bit architectures.

```
/usr/lib/gcc-cross/m68k-linux-gnu/14/../../../../m68k-linux-gnu/bin/ld: ../../libruby-static.a(vm.o): in function `rbimpl_atomic_u64_set_relaxed':
/home/ubuntu/build/ruby/master/m68k-linux/../src/ruby_atomic.h:60:(.text+0x2468): undefined reference to `__atomic_store_8'
/usr/lib/gcc-cross/m68k-linux-gnu/14/../../../../m68k-linux-gnu/bin/ld: ../../libruby-static.a(vm.o): in function `rbimpl_atomic_u64_load_relaxed':
/home/ubuntu/build/ruby/master/m68k-linux/../src/ruby_atomic.h:43:(.text+0x2950):
undefined reference to `__atomic_load_8'
```
2025-06-04 15:31:28 +09:00
Nobuyoshi Nakada
47f55b4b44
Mark as NORETURN 2025-06-04 15:27:45 +09:00
Jean Boussier
206110a2a8 Add missing lock in rb_ivar_defined
If called on a class, we should acquire the lock.
2025-06-04 08:26:20 +02:00
Hiroshi SHIBATA
1f4913db97 [ruby/did_you_mean] Revert "Alias value to take in old Ruby"
This reverts commit https://github.com/ruby/did_you_mean/commit/15d7b0bfa573.

https://github.com/ruby/did_you_mean/commit/86a7daca19
2025-06-04 06:14:27 +00:00
Jean Boussier
6b8dcb7c8f shape.c: fix off by one error in shape_tree_mark 2025-06-04 07:59:20 +02:00
Jean Boussier
bbd5a5a81d vm_getivar: normalize shape_id to ignore frozen state
Freezing an object changes its `shape_id` This is necessary
so that `setivar` routines can use the `shape_id` as a cache key
and save on checking the frozen status every time.

However for `getivar` routines, this causes needless cache misses.
By clearing that bit we increase hit rate in codepaths that see
both frozen and mutable objects.
2025-06-04 07:59:20 +02:00
Jean Boussier
625d6a9cbb Get rid of frozen shapes.
Instead `shape_id_t` higher bits contain flags, and the first one
tells whether the shape is frozen.

This has multiple benefits:
  - Can check if a shape is frozen with a single bit check instead of
    dereferencing a pointer.
  - Guarantees it is always possible to transition to frozen.
  - This allow reclaiming `FL_FREEZE` (not done yet).

The downside is you have to be careful to preserve these flags
when transitioning.
2025-06-04 07:59:20 +02:00
Hiroshi SHIBATA
6b7e3395a4 [ruby/psych] Revert "Alias value or join to take in old Ruby"
This reverts commit https://github.com/ruby/psych/commit/1a4d383efe0b.

https://github.com/ruby/psych/commit/2f51c02280
2025-06-04 05:51:19 +00:00