95791 Commits

Author SHA1 Message Date
BurdetteLamar
bd64cf00a2 [DOC] Tweaks for String#capitalize 2025-12-05 19:05:55 -08:00
BurdetteLamar
2491a504ff [DOC] Tweaks for String#downcase 2025-12-05 19:05:18 -08:00
BurdetteLamar
e5e4175dbd [DOC] Tweaks for String#upcase 2025-12-05 19:04:59 -08:00
BurdetteLamar
da2c67388a [DOC] Tweaks for String#swapcase 2025-12-05 19:04:23 -08:00
BurdetteLamar
bbef73b2ff [DOC] Better multibyte-character data 2025-12-05 19:03:22 -08:00
BurdetteLamar
734dab5ec8 [ruby/stringio] [DOC] Link to on-page section, not class File doc
https://github.com/ruby/stringio/commit/dc93aa51d2
2025-12-06 03:02:45 +00:00
Samuel Williams
a7dc53b91c
Add support for u128, U128, s128 and S128 integers to IO::Buffer. (#15399) 2025-12-06 15:55:32 +13:00
Peter Zhu
8f9838476d Fix fields object in embedded struct
We don't set RSTRUCT_GEN_FIELDS when RCLASS_MAX_IV_COUNT(klass) != 0, so
we need to set RSTRUCT_SET_FIELDS_OBJ to 0 otherwise it may have an
invalid value and crash.
2025-12-05 15:40:39 -08:00
Peter Zhu
791acc5697 Revert "gc.c: Pass shape_id to newobj_init"
This reverts commit 228d13f6ed914d1e7f6bd2416e3f5be8283be865.

This commit makes default.c and mmtk.c depend on shape.h, which prevents
them from building independently.
2025-12-05 15:40:39 -08:00
Benoit Daloze
65995c22f8 [ruby/timeout] Exclude constantly-failing test on x86_64-darwin
* https://github.com/ruby/ruby-dev-builder/actions/runs/19973218359/job/57293388626

https://github.com/ruby/timeout/commit/45816b1b26
2025-12-05 22:09:52 +00:00
Stan Lo
c4c909b538
ZJIT: Include local variable names in Get|SetLocal insn's print value (#15423)
ZJIT: Print local variable names GetLocal and SetLocal instructions
2025-12-05 22:00:24 +00:00
Alan Wu
d396a66a82 ZJIT: Build by default when build environment allows
"Default" means when `--enable-zjit` is absent from `./configure`
arguments.
2025-12-05 15:49:25 -05:00
Alan Wu
f559a9106c ZJIT: configure.ac: Look for GNU make when detecting build environment
Building ZJIT requires GNU make at the moment.
To get access to `$gnumake`, lift the `make` flavour detection up to the
environment section, before the JIT section runs.
2025-12-05 15:49:25 -05:00
Alan Wu
ffe99a56de ZJIT: configure.ac logic to detect suitable build environment
This runs the detection, but does nothing with the result.

 * Fixed version requirement in messages -- ZJIT requires >= 1.85 unlike
  YJIT.
 * New: Detect when rust 1.85 is available, and neither --enable-yjit nor
  --enable-zjit is passed to ./configure, include both YJIT and ZJIT
  in the build
2025-12-05 15:49:25 -05:00
Alan Wu
9a2710013c YJIT: Fix unused_unsafe warning in StatsAlloc 2025-12-05 15:49:25 -05:00
Alan Wu
dce716e25b ZJIT: Update depend for zjit.o 2025-12-05 15:49:25 -05:00
Alan Wu
addeafdd5b YJIT: Fix duplicate make rule warning in combo build 2025-12-05 15:49:25 -05:00
Alan Wu
8296524fd6 ZJIT: Fix duplicate make rule warning in combo build
~/zjit/zjit.mk:30: warning: overriding commands for target `~/build-default/'
    ~/yjit/yjit.mk:26: warning: ignoring old commands for target `~/build-default/'
    ~/zjit/zjit.mk:30: warning: overriding commands for target `~/build-default/'
    ~/yjit/yjit.mk:26: warning: ignoring old commands for target `~/build-default/'
2025-12-05 15:49:25 -05:00
Alan Wu
2bc9b5a854 tool/update-deps: Skip ZJIT and YJIT+ZJIT build objects 2025-12-05 15:49:25 -05:00
Alan Wu
fb72ff7be0 CI: Avoid building ZJIT when LLVM is too old 2025-12-05 15:49:25 -05:00
Alan Wu
109ddd291e ZJIT: Avoid binding to rb_iseq_constant_body
Its definition changes depending on e.g. whether there is YJIT in the
build.
2025-12-05 15:49:25 -05:00
Alan Wu
8132b3d1d8 YJIT: Fix including stats for ZJIT instructions when ZJIT not in build 2025-12-05 15:49:25 -05:00
Alan Wu
f01fd2bde2 JITs: Update bindings to include interpreter zjit_ opcodes
Mostly YJIT. ZJIT already has the right bindings and this just tweaks
the CI configuration.
2025-12-05 15:49:25 -05:00
Alan Wu
02ca507aa3 JITs: rb_iseq_opcode_at_pc(): Accommodate switch-case interpreter 2025-12-05 15:49:25 -05:00
Alan Wu
7ecd369a87 ZJIT: Account for when YJIT is on by default in test_zjit_enable 2025-12-05 15:49:25 -05:00
Alan Wu
3269ae1b0d ZJIT: Fix -Wpedantic warning in C99 mode when built with YJIT
> insns.def:857:5: error: assigning to 'rb_zjit_func_t' (aka 'unsigned
> long (*)(struct rb_execution_context_struct *, struct
> rb_control_frame_struct *, unsigned long (*)(struct
> rb_execution_context_struct *, struct rb_control_frame_struct *))') from
> 'void *' converts between void pointer and function pointer
> [-Werror,-Wpedantic]
2025-12-05 15:49:25 -05:00
Alan Wu
ee7923288f ZJIT: Skip GC.auto_compact test when unsupported 2025-12-05 15:49:25 -05:00
Kevin Newton
786f673938 [ruby/prism] Correct constant pool bucket type logic
When replacing an owned constant by a different type (constant or
shared) replace with the correct type instead of defaulting to
shared.

https://github.com/ruby/prism/commit/fbe9b131a1
2025-12-05 20:35:31 +00:00
Steven Johnstone
be12e19856 [ruby/prism] Avoid undefined int overflow behaviour
Fixes https://github.com/ruby/prism/pull/3786.

https://github.com/ruby/prism/commit/b72b664675
2025-12-05 20:21:28 +00:00
Steven Johnstone
834adc358a [ruby/prism] Avoid out-of-bounds reads
Fixes https://github.com/ruby/prism/pull/3784.

https://github.com/ruby/prism/commit/3fe862534b
2025-12-05 20:20:18 +00:00
Keenan Brock
2b05785941 Allow rb_thread_call_with_gvl() to work when thread already has GVL
[Feature #20750]

Co-authored-by: Benoit Daloze <eregontp@gmail.com>
2025-12-05 20:50:00 +01:00
Kazuki Yamaguchi
8c4f79d5f3 [ruby/openssl] x509cert: handle invalid validity periods in Certificate#inspect
In a newly allocated OpenSSL X509 object, the notBefore and notAfter
fields contain an ASN1_STRING object with type V_ASN1_UNDEF rather than
an ASN1_TIME.

Commit https://github.com/ruby/openssl/commit/73484f67949a made asn1time_to_time() stricter and it now raises
an exception if the argument is not an ASN1_TIME. Previously, it would
print a verbose-mode warning and return nil.

OpenSSL::X509::Certificate#inspect should work even when the certificate
is invalid. Let's handle this.

https://github.com/ruby/openssl/commit/18c283f2b6
2025-12-05 18:40:02 +00:00
Benoit Daloze
00b91c727f [ruby/timeout] Simplify logic to make GET_TIME shareable
https://github.com/ruby/timeout/commit/281b2507e7
2025-12-05 18:32:14 +00:00
Benoit Daloze
3e189ddb9d [ruby/timeout] Fix logic for Ractor support
* Fix indentation to stay a multiple of 2 spaces.

https://github.com/ruby/timeout/commit/a1d784cb66
2025-12-05 18:32:13 +00:00
Benoit Daloze
dc406af9cb [ruby/timeout] Fix condition and fix test to catch that broken condition
https://github.com/ruby/timeout/commit/82fb6f6925
2025-12-05 18:32:13 +00:00
Benoit Daloze
a523e9d872 [ruby/timeout] Minor tweaks
https://github.com/ruby/timeout/commit/daab9a2193
2025-12-05 18:32:13 +00:00
Koichi Sasada
ec28bd75a8 [ruby/timeout] support Ractor
1. Introduce State to store all status.
2. Store State instance to the Ractor local storage if possible
3. Make `GET_TIME` (Method object) shareable if possible

3 is supporeted Ruby 4.0 and later, so the Rator support is works
only on Ruby 4.0 and later.

https://github.com/ruby/timeout/commit/54ff671c6c
2025-12-05 18:32:13 +00:00
Étienne Barrié
65dbd571c1 [ruby/psych] Use Node#to_ruby parse_symbols option
https://github.com/ruby/psych/commit/907fd4fa97
2025-12-05 17:14:30 +00:00
John Hawthorn
930afa1c7b Never shrink bignum on realloc
As far as I can tell, this only ever shrinks by one, and it's really not
worth the expensive realloc for that.
2025-12-05 06:21:17 -08:00
John Hawthorn
b0c9286d98 Use VWA for bignum
Previously we only allocated bignums from the 40 byte sizepool, and
embedded bignum used a fixed size.
2025-12-05 06:21:17 -08:00
Daisuke Aritomo
ea415e9636 [ruby/net-http] open: Never call Timeout.timeout in rescue clause
The try-open_timeout-then-fallback-to-timeout introduced in
https://github.com/ruby/net-http/commit/1903cedd8cd0 works well, but when it errors
due to any reason in Rubies which do not support `open_timeout`, it
spits the rescued ArgumentError that is unrelated to user code and not
actionable.

    Net::HTTP.start('foo.bar', 80)

    /.../net-http-0.8.0/lib/net/http.rb:1691:in 'TCPSocket#initialize': Failed to open TCP connection to foo.bar:80 (getaddrinfo(3): nodename nor servname provided, or not known) (Socket::ResolutionError)
            from /.../net-http-0.8.0/lib/net/http.rb:1691:in 'IO.open'
            from /.../net-http-0.8.0/lib/net/http.rb:1691:in 'block in Net::HTTP#connect'
            from /.../timeout-0.4.4/lib/timeout.rb:188:in 'block in Timeout.timeout'
            from /.../timeout-0.4.4/lib/timeout.rb:195:in 'Timeout.timeout'
            from /.../net-http-0.8.0/lib/net/http.rb:1690:in 'Net::HTTP#connect'
            from /.../net-http-0.8.0/lib/net/http.rb:1655:in 'Net::HTTP#do_start'
            from /.../net-http-0.8.0/lib/net/http.rb:1635:in 'Net::HTTP#start'
            from /.../net-http-0.8.0/lib/net/http.rb:1064:in 'Net::HTTP.start'
            (snip)
    /.../net-http-0.8.0/lib/net/http.rb:1682:in 'TCPSocket#initialize': unknown keyword: :open_timeout (ArgumentError)

              sock = TCPSocket.open(conn_addr, conn_port, @local_host, @local_port, open_timeout: @open_timeout)
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            from /.../net-http-0.8.0/lib/net/http.rb:1682:in 'IO.open'
            from /.../net-http-0.8.0/lib/net/http.rb:1682:in 'Net::HTTP#connect'
            from /.../net-http-0.8.0/lib/net/http.rb:1655:in 'Net::HTTP#do_start'
            from /.../net-http-0.8.0/lib/net/http.rb:1635:in 'Net::HTTP#start'
            from /.../net-http-0.8.0/lib/net/http.rb:1064:in 'Net::HTTP.start'
            (snip)
            ... 8 levels...

This patch suppresses the ArgumentError by moving the retry out of the
rescue clause.

https://github.com/ruby/net-http/commit/86232d62f5
2025-12-05 12:34:14 +00:00
Kazuki Yamaguchi
f179885d3c [ruby/openssl] asn1: use ASN1_TIME_to_tm() to decode UTCTime and GeneralizedTime
The current logic relies on sscanf() and error checks are almost
entirely missing. It also assumes that ASN1_STRING contents are NUL
terminated, which is undocumented and not guaranteed for all valid
ASN1_TIME objects.

Switch to using ASN1_TIME_to_tm() added in OpenSSL 1.1.1. It is also
supported by LibreSSL and AWS-LC.

In the long term, we may want to replace ASN1_TIME_to_tm() with a
hand-rolled decoder, since the function is intended for a specific
use-case. It is too permissive for strict DER, yet still does not
support all valid DER inputs and silently drops information such as
fractional seconds. However, it handles everything that the current
sscanf() code could handle.

https://github.com/ruby/openssl/commit/73484f6794
2025-12-05 12:24:54 +00:00
Kazuki Yamaguchi
bf2b9c0947 [ruby/openssl] asn1: reorder declarations
Move variable declarations for OpenSSL::ASN1 classes to the top of the
file. asn1time_to_time() will need eASN1Error in the next patch.

https://github.com/ruby/openssl/commit/6c0ef87897
2025-12-05 12:24:54 +00:00
Benoit Daloze
95ea3bd5ee [ruby/timeout] Only the timeout method should be public on the Timeout module
https://github.com/ruby/timeout/commit/cd51eac3ca
2025-12-05 11:35:21 +00:00
Nobuyoshi Nakada
1cad20e2d5
[DOC] Describe $F
This variation is used when `-a` option is given.
2025-12-05 16:47:39 +09:00
Nobuyoshi Nakada
1e7373ef30
[DOC] Describe the global variables set by command line options
These variables are set by command line options, but it is deprecated
to assign them any value other than nil in ruby code.
2025-12-05 16:31:36 +09:00
Nobuyoshi Nakada
b35aff5813
[DOC] Centerize Variable, English, and Constant columns 2025-12-05 16:14:15 +09:00
Jeremy Evans
479185daa1 Add Set C API to news
Also, don't use backticks around Set in the top level of the
Core classes updates section, as other classes/modules do not use
that format.
2025-12-05 15:31:40 +09:00
Sharon Rosner
5f6b31c23f
Correctly handle Process.fork with an active Fiber.scheduler. (#15385)
In the child process, nullify the current fiber scheduler and set the current fiber to blocking.
2025-12-05 18:20:39 +13:00
Yusuke Endoh
e822209d3e
Update NEWS.md for Ruby 4.0.0 (#15369)
I extracted the relevant descriptions from the draft NEWS.md that
hsbt-san had Gemini generate by analyzing `git log`.

Co-authored-by: Hiroshi SHIBATA <hsbt@ruby-lang.org>
Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
Co-authored-by: Jeremy Evans <code@jeremyevans.net>
Co-Authored-By: Earlopain <14981592+Earlopain@users.noreply.github.com>
2025-12-05 05:16:25 +00:00