Commit graph

92841 commits

Author SHA1 Message Date
Nobuyoshi Nakada
8a31a0792b [DOC] Include pathname_builtin.rb documents 2025-07-15 20:51:16 +09:00
Daisuke Aritomo
b896f80598
[Bug #21512] Socket.tcp_with_fast_fallback: Pass proper addr family to getaddrinfo (#13878)
Socket.tcp_with_fast_fallback: Pass proper addr family to getaddrinfo

Addrinfo.getaddrinfo expects Socket::AF_INET or Socket::AF_INET6 as its
third argument (family). However Socket.tcp_with_fast_fallback was
incorrectly passing :ipv4 or :ipv6.

Repro:

    require 'socket'
    Socket.tcp_with_fast_fallback('example.com', 80, '127.0.0.1')

Expected behavior: Returns a Socket object
Actual: Raises unknown socket domain: ipv4 (SocketError)
2025-07-15 20:38:57 +09:00
Jean Boussier
03800bff69 Make Pathname#mkpath builtin
[Feature #17473]
2025-07-15 12:57:18 +02:00
Nobuyoshi Nakada
4fab4cfe35 [ruby/pathname] Fix Init and InitVM
2b63d44453
2025-07-15 19:33:34 +09:00
Jean Boussier
6fd108dd6b id_table.c: reduce duplication in managed_id_table methods 2025-07-15 12:10:52 +02:00
Nobuyoshi Nakada
562599e6bc
Skip URI::TestMailTo#test_email_regexp for now 2025-07-15 16:52:03 +09:00
git
e27c1152aa Update default gems list at ea880e624e [ci skip] 2025-07-15 07:25:26 +00:00
Hiroshi SHIBATA
ea880e624e [ruby/etc] Bump up v1.4.6
c9c9b9d15e
2025-07-15 07:24:28 +00:00
Hiroshi SHIBATA
b67e10257c pathname.rbinc conflicts with lib/pathname.rb in our test suite.
We can use `pathname.rb` after merging `lib/pathname.rb` to `pathname_builtin.rb`.
2025-07-15 15:59:11 +09:00
git
647b98a9e1 Update default gems list at 2ffd6c28ed [ci skip] 2025-07-15 06:27:25 +00:00
Hiroshi SHIBATA
2ffd6c28ed [ruby/io-nonblock] Bump up 0.3.2
7285725885
2025-07-15 06:26:44 +00:00
git
d2deeaf1f6 Update default gems list at 8ea57040f0 [ci skip] 2025-07-15 06:01:50 +00:00
Hiroshi SHIBATA
8ea57040f0 [ruby/io-console] Bump up 0.8.1
01071a174a
2025-07-15 06:01:01 +00:00
Nobuyoshi Nakada
a6f0a24e19
Remove no longer used ext/pathname/depend [ci skip] 2025-07-15 14:48:34 +09:00
Hiroshi SHIBATA
69d4c67347 Provide pathname.so with embedded Pathname 2025-07-15 13:36:03 +09:00
Hiroshi SHIBATA
8794406583 Move builtin methods to pathname.rbinc from lib/pathname.rb 2025-07-15 11:17:51 +09:00
Hiroshi SHIBATA
98ea78f347 Make Pathname to embedded class 2025-07-15 11:17:51 +09:00
Alan Wu
3922a14a22 ZJIT: Make lir::Opnd::const_ptr take any pointer to save on casts 2025-07-14 22:11:24 -04:00
Alan Wu
7a7f128d0d ZJIT: Add a ccall macro that also adds an LIR comment
This DRYs up the `asm_comment!` + `asm.ccall` combo, and makes ccalls
have a comment by default.
2025-07-14 22:11:24 -04:00
Hiroshi SHIBATA
d23f666da3 Split restore and save actions from action/cache. We need to save always vcpkg cache 2025-07-15 08:34:13 +09:00
Max Bernstein
a6d483971a ZJIT: Make debug info more detailed
Print the filename, line number, and whether or not the function has
been optimized:

```
Initial HIR:
fn initialize@test.rb:4:
bb0(v0:BasicObject):
  v2:Fixnum[1] = Const Value(1)
  SetIvar v0, :@a, v2
  Return v2

Optimized HIR:
fn initialize@test.rb:4:
bb0(v0:BasicObject):
  v2:Fixnum[1] = Const Value(1)
  SetIvar v0, :@a, v2
  Return v2
```
2025-07-14 16:34:32 -04:00
Kunshan Wang
3a47f4eacf YJIT: Move RefCell one level down
This is the second part of making YJIT work with parallel GC.

During GC, `rb_yjit_iseq_mark` and `rb_yjit_iseq_update_references` need
to resolve offsets in `Block::gc_obj_offsets` into absolute addresses
before reading or updating the fields.  This needs the base address
stored in `VirtualMemory::region_start` which was previously behind a
`RefCell`.  When multiple GC threads scan multiple iseq simultaneously
(which is possible for some GC modules such as MMTk), it will panic
because the `RefCell` is already borrowed.

We notice that some fields of `VirtualMemory`, such as `region_start`,
are never modified once `VirtualMemory` is constructed.  We change the
type of the field `CodeBlock::mem_block` from `Rc<RefCell<T>>` to
`Rc<T>`, and push the `RefCell` into `VirtualMemory`.  We extract
mutable fields of `VirtualMemory` into a dedicated struct
`VirtualMemoryMut`, and store them in a field `VirtualMemory::mutable`
which is a `RefCell<VirtualMemoryMut>`.  After this change, methods that
access immutable fields in `VirtualMemory`, particularly `base_ptr()`
which reads `region_start`, will no longer need to borrow any `RefCell`.
Methods that access mutable fields will need to borrow
`VirtualMemory::mutable`, but the number of borrowing operations becomes
strictly fewer than before because borrowing operations previously done
in callers (such as `CodeBlock::write_mem`) are moved into methods of
`VirtualMemory` (such as `VirtualMemory::write_bytes`).
2025-07-14 16:21:55 -04:00
Kunshan Wang
51a3ea5ade YJIT: Set code mem permissions in bulk
Some GC modules, notably MMTk, support parallel GC, i.e. multiple GC
threads work in parallel during a GC.  Currently, when two GC threads
scan two iseq objects simultaneously when YJIT is enabled, both threads
will attempt to borrow `CodeBlock::mem_block`, which will result in
panic.

This commit makes one part of the change.

We now set the YJIT code memory to writable in bulk before the
reference-updating phase, and reset it to executable in bulk after the
reference-updating phase.  Previously, YJIT lazily sets memory pages
writable while updating object references embedded in JIT-compiled
machine code, and sets the memory back to executable by calling
`mark_all_executable`.  This approach is inherently unfriendly to
parallel GC because (1) it borrows `CodeBlock::mem_block`, and (2) it
sets the whole `CodeBlock` as executable which races with other GC
threads that are updating other iseq objects.  It also has performance
overhead due to the frequent invocation of system calls.  We now set the
permission of all the code memory in bulk before and after the reference
updating phase.  Multiple GC threads can now perform raw memory writes
in parallel.  We should also see performance improvement during moving
GC because of the reduced number of `mprotect` system calls.
2025-07-14 16:21:55 -04:00
Takashi Kokubun
e288a86692
ZJIT: Restore SP register after JIT-to-JIT call (#13882)
Co-authored-by: Alan Wu <alansi.xingwu@shopify.com>
Co-authored-by: Stan Lo <stan.lo@shopify.com>
2025-07-14 12:22:13 -07:00
Peter Zhu
b2a7b76992 Remove dead rb_cc_table_free 2025-07-14 11:11:47 -04:00
Peter Zhu
127cc425b7 Remove dead rb_cc_table_mark 2025-07-14 11:11:47 -04:00
Burdette Lamar
64d4e7727e
[DOC] Tweaks for String#delete_suffix! (#13872) 2025-07-14 10:05:00 -04:00
BurdetteLamar
07a3ab53a2 [DOC] Tweaks for String#delete_suffix 2025-07-14 09:58:35 -04:00
BurdetteLamar
55dd2022fd [DOC] Tweaks for String#delete_prefix! 2025-07-14 09:58:12 -04:00
BurdetteLamar
d38bb4ad1c [DOC] Tweaks for String#delete_prefix 2025-07-14 09:57:19 -04:00
Nobuyoshi Nakada
8f54b5bb93 [ruby/uri] [DOC] Update old use of URI::Parser
d2a79c6343
2025-07-14 05:11:58 +00:00
Nobuyoshi Nakada
d147091418 [ruby/uri] [DOC] Document private visibility too
For the references to URI::RFC2396_Parser private methods.

372fbb455d
2025-07-14 05:11:58 +00:00
Nobuyoshi Nakada
1a03270a7e [ruby/uri] [DOC] Fix references
These are instance methods, not class methods.  And `URI::Parser` was
moved to URI::RFC2396_Parser at [r46491]

[r46491]: bb83f32dc3

452d74390c
2025-07-14 05:11:58 +00:00
David Rodríguez
7a03a02bee
[rubygems/rubygems] Fix more warnings when running old Bundler with latest RubyGems
Also fix platform warnings when Bundler's entrypoint is bundler's
binstub.

4b1df58403
2025-07-14 11:52:14 +09:00
David Rodríguez
c3d41492e1
[rubygems/rubygems] Avoid more warnings when using RubyGems with old Bundler
We were only avoiding them when the RUBYGEMS_GEMDEPS variable is used.
Avoid the warnings in general, whenever the entrypoint to Bundler is
`require`.

8683faef36
2025-07-14 11:52:14 +09:00
David Rodríguez
a93c684077
[rubygems/rubygems] Change helper to load only Bundler extensions to RubyGems
We'll want to reuse this helper in other situations where we don't want
all Bundler loaded.

9e7018b0a1
2025-07-14 11:52:14 +09:00
David Rodríguez
1c48aa6f4a
[rubygems/rubygems] Move loading Bundler without platform warnings to a method
e068f0649a
2025-07-14 11:52:14 +09:00
David Rodríguez
4651d235db
[rubygems/rubygems] No need to detect ancient binstubs either
346d491a11
2025-07-14 11:52:14 +09:00
David Rodríguez
15751af90b
[rubygems/rubygems] Improve some heredoc indentations
6ee3a33048
2025-07-14 11:52:13 +09:00
David Rodríguez
f1cbd58acc
[rubygems/rubygems] Stop generating binstubs with support for RubyGems before 2.6.2
RubyGems generated binstubs still provide support for this ancient
version. This makes no sense since we prevent downgrades to such old
versions.

089cdc3b77
2025-07-14 11:52:13 +09:00
David Rodríguez
51e890030f
[rubygems/rubygems] Reset tmp directories before spec suite
If you abort running test suite with a quick double Ctrl-C, tmp files
will be left around, and they will interfere with the next test run.

To avoid this, make sure to clear them once at the beginning of the test
suite.

### Before

```
$ bin/parallel_rspec
16 processes for 175 specs, ~ 11 specs per process
.............................................................................................^C^C

Finished in 19.45 seconds (files took 0.42722 seconds to load)
94 examples, 0 failures

(... turbo tests backtrace ...)

$ bin/parallel_rspec
16 processes for 175 specs, ~ 11 specs per process
.F....F....F...F......^C

Failures:

(... failures' details ...)
```

### After

```
$ bin/parallel_rspec
16 processes for 175 specs, ~ 11 specs per process
.................................................................................^C^C

Finished in 18.18 seconds (files took 0.4383 seconds to load)
82 examples, 0 failures

(... turbo tests backtrace ...)

$ bin/parallel_rspec
16 processes for 175 specs, ~ 11 specs per process
................................................................................^C^C

Finished in 8.79 seconds (files took 0.45187 seconds to load)
80 examples, 0 failures

(... turbo tests backtrace ...)
```

6767a52711
2025-07-14 11:52:13 +09:00
David Rodríguez
7dc284189a
[rubygems/rubygems] Load RubyGems extensions in the first place
This is not currently causing any issues, but I think the most correct
thing to do is that Bundler loads the extensions to RubyGems in the
first place, so that they are available from the beginning.

88faa5c7bb
2025-07-14 11:52:13 +09:00
Nobuyoshi Nakada
55baf026ac
Fix an indent [ci skip] 2025-07-14 11:19:10 +09:00
Nobuyoshi Nakada
f03cc0b514 [ruby/uri] Repeat matching to reduce deviations
fa49e5b8ae
2025-07-13 04:37:15 +00:00
Nobuyoshi Nakada
9c166d26b2 [ruby/uri] Test in exponential scale with rehearsal
be35e0b4d8
2025-07-13 04:37:15 +00:00
BurdetteLamar
b438915f0a [DOC] TWeaks for String#delete! 2025-07-12 14:22:57 -04:00
BurdetteLamar
e1bc92d00b [DOC] Tweaks for String#delete 2025-07-12 13:08:14 -04:00
Burdette Lamar
b0db93c002
[DOC] Tweaks for String#count 2025-07-12 10:55:33 -04:00
Nobuyoshi Nakada
9e7a985c6d
[Bug #21509] [DOC] Correct IO#wait description 2025-07-12 22:34:52 +09:00
Nobuyoshi Nakada
dbf7a0c713 [ruby/io-wait] [Bug #21509] [DOC] Correct IO#wait description
c65af887a1
2025-07-12 13:32:33 +00:00