Commit graph

93077 commits

Author SHA1 Message Date
Jean Boussier
8e426a3aee [ruby/json] Release 2.13.2
9e3efbfa22
2025-07-29 10:41:09 +09:00
Takashi Kokubun
f1acf47ca2
YJIT: Call YJIT hooks before enabling YJIT (#14032) 2025-07-28 15:17:45 -07:00
Stan Lo
a0d0b84bad
ZJIT: Support invalidating constant patch points (#13998) 2025-07-28 14:48:41 -07:00
Peter Zhu
23000e7123 Remove unnecessary internal/gc.h include in hash.c
hash.c compiles just fine on HASH_DEBUG without including internal/gc.h.
2025-07-28 17:18:35 -04:00
Jason Garber
e15f1a71ad [ruby/tsort] Add changelog_uri to gemspec metadata
Adds a link to the GitHub Releases page for this gem consistent with other gems in the Ruby organization. Existing examples include:

- [json](https://github.com/ruby/json/blob/master/json.gemspec)
- [ostruct](https://github.com/ruby/ostruct/blob/master/ostruct.gemspec)

8086bb33bc
2025-07-28 20:14:38 +00:00
Max Bernstein
3f22434e1a ZJIT: Fix land race 2025-07-28 15:36:20 -04:00
Max Bernstein
b2b2aff61d ZJIT: Mark Symbol, Float, NilClass, TrueClass, FalseClass as final
They can be subclassed but new instances cannot be created.
2025-07-28 12:35:21 -07:00
Max Bernstein
f6dccdb1ff ZJIT: Remove Integer subclasses from lattice
While Integer can technically be subclassed, instances of subclasses
cannot be created. Remove it from the type lattice.
2025-07-28 12:35:21 -07:00
Stan Lo
043489abc2
ZJIT: Inline guard type checks for some built-in types (#14017)
This implements similar fast-path guard type checks as YJIT.
2025-07-28 15:32:32 -04:00
Alan Wu
ff428b4dd0 ZJIT: Keep a frame pointer and use it for memory params
Previously, ZJIT miscompiled the following because of native SP
interference.

    def a(n1,n2,n3,n4,n5,n6,n7,n8) = [n8]
    a(0,0,0,0,0,0,0, :ok)

Commented problematic disassembly:

    ; call rb_ary_new_capa
    mov x0, #1
    mov x16, #0x1278
    movk x16, #0x4bc, lsl #16
    movk x16, #1, lsl #32
    blr x16
    ; call rb_ary_push
    mov x1, x0
    str x1, [sp, #-0x10]! ; c_push() from alloc_regs()
    mov x0, x1            ; arg0, the array
    ldur x1, [sp]         ; meant to be arg1=n8, but sp just moved!
    mov x16, #0x3968
    movk x16, #0x4bc, lsl #16
    movk x16, #1, lsl #32
    blr x16

Since the frame pointer stays constant in the body of the function,
static offsets based on it don't run the risk of being invalidated by SP
movements.

Pass the registers to preserve through Insn::FrameSetup. This allows ARM
to use STP and waste no gaps between EC, SP, and CFP.

x86 now preserves and restores RBP since we use it as the frame pointer.
Since all arches now have a frame pointer, remove offset based SP
movement in the epilogue and restore registers using the frame pointer.
2025-07-28 15:30:50 -04:00
John Hawthorn
5ca71364ff Avoid GC while operands in inconsistent state
compile_data_calloc2 may run GC (though because it allocates from an
arena this is rare in practice). When this happened when resizing
operands there was a risk of seeing the insn in an inconsistent state.

To solve this we need to make any allocations before we start modifying
the instrucitons. This refactors the code to use a new
insn_replace_with_operands() function that allocates the new operands
array before modifying the instruction object.

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2025-07-28 09:44:47 -07:00
Peter Zhu
7913aff2b3 [DOC] Fix return value of rb_str_hash_cmp
rb_str_hash_cmp returns 0 if the two strings are identical and 1 if they
are different.
2025-07-28 09:34:25 -04:00
Olle Jonsson
d0bb17e079 [ruby/shellwords] shellwords.gemspec: Avoid configuring exe/ directory
This gem does not ship any executables.

7da06b91ff
2025-07-28 13:18:05 +00:00
Jean Boussier
d488935910 Get rid of ID_JUNK
It has been aliased as ID_INTERNAL for a long time and that alias
is much more descriptive.
2025-07-28 12:22:42 +02:00
Nobuyoshi Nakada
1a68f1b199
Extract checks for the block in lazy enumerator 2025-07-28 17:54:09 +09:00
Kazuki Yamaguchi
32977f3869 [rubygems/rubygems] Avoid openssl bug in test_verify_certificate_extra_message
OpenSSL::X509::StoreContext#current_cert returns an empty and invalid
OpenSSL::X509::Certificate instance if it is called before starting a
certificate verification.
https://redirect.github.com/ruby/openssl/pull/919 will change it to
return nil instead in such a case.

Adjust test_verify_certificate_extra_message to actually complete
StoreContext#verify so that it will not rely on this behavior.

823799088d
2025-07-28 17:02:57 +09:00
Hiroshi SHIBATA
2256b0ffa4
Ignore *.rbbin
Followed up with fb6f255028
2025-07-28 10:04:29 +09:00
David Rodríguez
95fdaa5c3b
(Temporarily?) delay path changes and global cache changes
There are several issues with these which I'm not sure I'll have time to
address properly. I prefer to keep our default branch in a releasable
state just in case. Once they are fixed, this can be reverted.
2025-07-28 10:01:58 +09:00
Jean Boussier
48a79cd492 [ruby/json] Improve deprecation warning location detection
132049bde2
2025-07-28 09:39:12 +09:00
Jean Boussier
d0020d58f4 [ruby/json] Fix duplicated key warning location
Followup: https://github.com/ruby/json/pull/818

Now the warning should point at the `JSON.parse` caller, and not
inside the json gem itself.

cd51557387
2025-07-28 09:39:12 +09:00
Jean Boussier
b4ef5da70b [ruby/json] Improve duplicate key warning and errors to include the key name
Followup: https://github.com/ruby/json/pull/818

e3de4cc59c
2025-07-28 09:39:11 +09:00
David Rodríguez
0dc86fd843 [rubygems/rubygems] Remove unnecessary branching
We now run specs against a single version, so I prefer to keep a single
branch. Once we bump the major version, this will need very little
updates, and that seems fine.

3866d25a00
2025-07-28 09:39:03 +09:00
David Rodríguez
2690d21067 [rubygems/rubygems] The install_gemfile helper has not set "retry" for a long time
41dab5954f
2025-07-28 09:39:02 +09:00
Nobuyoshi Nakada
f8e002a6b7 [ruby/English] Exclude unused files from gem
6bea25038b
2025-07-27 15:18:50 +00:00
Nobuyoshi Nakada
a9eed306aa
Update comments for pack/unpack tests [ci skip]
More comprehensive pack/unpack tests are in test_pack.rb.
2025-07-28 00:06:44 +09:00
Kazuki Yamaguchi
ec01cd9bbb Revert "[ruby/openssl] x509: disallow ossl_x509{,attr,crl,ext,revoked,name}*_new(NULL)"
This reverts commit 4e8bbb07dd.

It broke RubyGems tests:
20250727T123003Z.fail.html.gz

OpenSSL::X509::StoreContext#current_cert incorrectly calls
ossl_x509_new() with NULL to create a bogus Certificate object, and a
test case in RubyGems relies on it. This will be reapplied when both
are fixed.
2025-07-27 22:56:10 +09:00
Erim Icel
9eda3cf423
Add test for String#byteslice with multibyte characters 2025-07-27 22:03:54 +09:00
Kazuki Yamaguchi
1c18ab81db [ruby/openssl] pkey: rename ossl_pkey_new() to ossl_pkey_wrap()
Among functions named ossl_*_new(), ossl_pkey_new() is now the only one
that takes ownership of the passed OpenSSL object instead of making a
copy or incrementing its reference counter. Rename it to make this
behavior easier to understand.

54c1c26eb5
2025-07-27 12:17:25 +00:00
Kazuki Yamaguchi
f85dafebe8 [ruby/openssl] ocsp: refactor ossl_ocspcertid_new()
Likewise, let it take a const pointer and not the ownership of the
OpenSSL object.

This fixes potential memory leak in OpenSSL::OCSP::BasicResponse#status.

7e0288ebbd
2025-07-27 12:17:25 +00:00
Kazuki Yamaguchi
5a04353417 [ruby/openssl] ocsp: refactor ossl_ocspsres_new()
Similar to most of the other ossl_*_new() functions, let it take a const
pointer and make a copy of the object.

This also fixes a potential memory leak when the wrapper object
allocation fails.

eaabf6d8a3
2025-07-27 12:17:24 +00:00
Kazuki Yamaguchi
e80c3f3ba9 [ruby/openssl] pkcs7: disallow ossl_pkcs7{si,ri}_new(NULL)
These functions are not actually called with NULL.

c089301e56
2025-07-27 12:17:24 +00:00
Kazuki Yamaguchi
4e8bbb07dd [ruby/openssl] x509: disallow ossl_x509{,attr,crl,ext,revoked,name}*_new(NULL)
These functions are not actually called with NULL. It also doesn't make
sense to do so, so let's simplify the definitions.

ef277083ba
2025-07-27 12:17:24 +00:00
Kazuki Yamaguchi
ba0b3ad4f3 [ruby/openssl] bn: avoid ossl_bn_new(NULL)
Currently, calling ossl_bn_new() with a NULL argument allocates a new
OpenSSL::BN instance representing 0. This behavior is confusing. Raise
an exception if this is attempted, instead.

6fa793d997
2025-07-27 12:17:23 +00:00
Kazuki Yamaguchi
64e8368f5b [ruby/openssl] lib/openssl.rb: require files in alphabetical order
This list was originally in alphabetical order. Sort it again.

This change should be safe since the .rb sources should only depend on
the extension and not each other.

eb3998728a
2025-07-27 12:16:33 +00:00
Jun Aruga
6e0181db3a [ruby/openssl] ssl: add post-quantum cryptography (PQC) tests
The key files were created by the following commands.

```
$ ${HOME}/.local/openssl-3.6.0-dev-fips-debug-8253b58d60/bin/openssl genpkey \
  -algorithm mldsa65 \
  -out mldsa65-1.pem
$ ${HOME}/.local/openssl-3.6.0-dev-fips-debug-8253b58d60/bin/openssl genpkey \
  -algorithm mldsa65 \
  -out mldsa65-2.pem
```

PQC algorithms, ML-KEM (FIPS 203) and ML-DSA (FIPS 204) used in the PQC tests
are supported on OpenSSL 3.5 or later.
https://openssl-library.org/post/2025-04-08-openssl-35-final-release/

f3bb316018
2025-07-27 12:15:02 +00:00
Nobuyoshi Nakada
0adecf500a
[ruby/json] Keep indentation consistent across functions [ci skip]
1988a3ae4c
2025-07-27 16:35:14 +09:00
Nobuyoshi Nakada
f5aee2480a [ruby/json] Functions defined in headers should be static inline
If `load_uint8x16_4` has an external linkage, it is defined in
both `generator` and `parser` extension libraries.  This duplicate
symbol causes a linker error when `--with-static-linked-ext` is
given, on some platforms.

020693b17a
2025-07-27 15:08:19 +09:00
Nobuyoshi Nakada
abafb662ea
Adjust indents [ci skip] 2025-07-26 22:07:28 +09:00
Nobuyoshi Nakada
fb6f255028
Rename builtin_binary.inc as .rbbin
Distinguish between platform-dependent ".rbbin" and platform-
independent ".inc" files.
2025-07-26 20:19:55 +09:00
Peter Zhu
bd2d6845f1 Remove VM lock in register_static_symid 2025-07-25 09:51:24 -04:00
Peter Zhu
42f95456cc Remove VM lock for sym_find 2025-07-25 09:51:24 -04:00
Peter Zhu
2235fdb6f1 Remove VM lock for rb_id_attrset 2025-07-25 09:51:24 -04:00
Hiroshi SHIBATA
9e105a5037 update-deps 2025-07-25 19:50:06 +09:00
Hiroshi SHIBATA
be7b1164e6 Split autogenerated dependency to depend file from common.mk 2025-07-25 19:50:06 +09:00
Nobuyoshi Nakada
199861424e Flush out-of-date gems at extracting bundled gems 2025-07-25 17:06:48 +09:00
git
bcce142878 Update default gems list at 93eed37e66 [ci skip] 2025-07-25 02:49:45 +00:00
Jean Boussier
93eed37e66 [ruby/json] Release 2.13.1
cfe9337eda
2025-07-25 11:11:24 +09:00
Jean Boussier
069a24c93c [ruby/json] Don't assume __builtin_cpu_supports exists
Fix: https://github.com/ruby/json/issues/827

On very old compilers it might not exist, at that point
might as well skip SIMD entirely.

da878435dc
2025-07-25 11:11:23 +09:00
John Hawthorn
b48904273a [ruby/json] Fix missing write barrier on Generator State
Found by wbcheck

   WBCHECK ERROR: Missed write barrier detected!
     Parent object: 0x7b7b8487c450 (wb_protected: true)
       rb_obj_info_dump: 0x00007b7b8487c450 JSON/Generator/State/JSON::Ext::Generator::State JSON/Generator/State
     Reference counts - snapshot: 1, writebarrier: 0, current: 6, missed: 5
     Missing reference to: 0x7b7b82f35a10
       rb_obj_info_dump: 0x00007b7b82f35a10 T_STRING/String  len: 1, capa: 15 "1"
     Missing reference to: 0x7b7b82f35e90
       rb_obj_info_dump: 0x00007b7b82f35e90 T_STRING/String  len: 1, capa: 15 "2"
     Missing reference to: 0x7b7b83629e50
       rb_obj_info_dump: 0x00007b7b83629e50 T_STRING/String  len: 1, capa: 15 "3"
     Missing reference to: 0x7b7b83b62190
       rb_obj_info_dump: 0x00007b7b83b62190 T_STRING/String  len: 1, capa: 15 "4"
     Missing reference to: 0x7b7b83629490
       rb_obj_info_dump: 0x00007b7b83629490 T_STRING/String  len: 1, capa: 15 "5"

c24342d801
2025-07-25 11:11:21 +09:00
Edouard CHIN
da3c47bcfc [rubygems/rubygems] Document missing options from man pages:
- The `bundle plugin uninstall --all` was missing.
- The `bundle plugin install --local-git` was missing due to being
  deprecated. We decided to reintroduce the doc for more clarity.

4da252945c
2025-07-25 11:10:42 +09:00