Commit graph

93064 commits

Author SHA1 Message Date
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
Edouard CHIN
4dd708bf5d [rubygems/rubygems] Add a quality spec to ensure man pages are up to date:
- Ref #8802
- ### Problem

  Whenever a bundler command options is added, we want to make
  sure that the associated command man page is updated to reflect
  the new option (e.g. this mistake was made in #8624)

  ### Solution

  In #8802 we discussed a bit on the implementation which would rely
  on parsing ronn files and introduce some conventions on how options
  documented in man pages should be written.

  I figured I would try a simpler approach by just checking if the man
  page of a command list options using a simple regex.

  Pros:

  - Simpler as we don't have to parse ronn files.
  - No need to modify all existing man pages.

  Cons:

  - We can only verify one way (CLI options -> man pages).
    If a CLI option get removed, we won't be able to warn that
    the existing document man page option needs to be removed.

e10e60bd33
2025-07-25 11:10:41 +09:00
Martin Emde
80712140af [rubygems/rubygems] Fix spacing in bundle gem newgem.gemspec.tt
The changelog line was generating indented more than it should.

da6109ef5b
2025-07-25 11:10:40 +09:00
David Rodríguez
416fde11eb [rubygems/rubygems] Fix language quality spec no longer getting run properly
c65e34a904
2025-07-25 11:10:39 +09:00
David Rodríguez
bfd0c15ffa [rubygems/rubygems] Fix man tracked files glob for ruby-core
The location has been consistent with upstream for a while so the
previous glob was no longer matching any files.

dae40b7041
2025-07-25 11:10:39 +09:00
David Rodríguez
2321091cfa [rubygems/rubygems] Don't create an empty tmp/2.1 directory when running spec:deps task
3189d3e49b
2025-07-25 11:10:38 +09:00
David Rodríguez
e67f595e8f [rubygems/rubygems] Build bundler gem just once for specs
When we need to reset system gems during specs, there's no need to
rebuild bundler, we can copy over the original gem home.

7b4f80747b
2025-07-25 11:10:37 +09:00
David Rodríguez
63c4223775 [rubygems/rubygems] Don't create an empty bundled_app when setting up deps
Running everything in `bundled_app` by default causes the `bundled_app`
helper to be used everytime, and that will create a scoped bundled_app
folder if it does not exist. That causes `bin/rake spec:deps` to create
an empty `tmp/2.1/bundled_app` folder which is a bit weird.

This commit changes specs to not switch to a (possibly empty)
bundled_app directory when not necessary (for example, when running
`gem` commands in order to setup test dependencies).

4bf89c0705
2025-07-25 11:10:36 +09:00
David Rodríguez
bc5b594946 [rubygems/rubygems] Remove some unnecessary artifice arguments
Since `sys_exec` does not actually set it.

abc0fd0599
2025-07-25 11:10:35 +09:00
David Rodríguez
ce0d71b3a7 [rubygems/rubygems] Simplify new gem spec that simulates "no git available"
I don't know why it was written like that.

ee83fddd30
2025-07-25 11:10:34 +09:00
David Rodríguez
b78406a032 [rubygems/rubygems] Fix some specs running the wrong rake
8d4eb154b1
2025-07-25 11:10:34 +09:00
David Rodríguez
e673bbf77b [rubygems/rubygems] Remove unused parameter
043f73586b
2025-07-25 11:10:33 +09:00
John Hawthorn
7f25b8f5fb Disable TSAN for rb_gc_mark_machine_context
Previously this was listed as a suppression, but we actually want this
permanently unsanitized. This should be faster and more reliable since
TASN won't have to match against symbolicated backtraces.
2025-07-24 16:35:42 -07:00
John Hawthorn
3ad2019259 Extract vm_locked_by_ractor_p
This introduces a new method to encapsulate checking whether the current
Ractor owns the vm->ractor.sync lock. This allows us to disable TSan on
it since that operation should be safe, and still get validation of
other uses.
2025-07-24 16:35:20 -07:00