Commit graph

89125 commits

Author SHA1 Message Date
Kazuki Yamaguchi
1df63d9451 [ruby/openssl] Mark variables and functions as static whenever possible
85d6b7f192
2024-12-07 07:55:47 +00:00
Kazuki Yamaguchi
cbe7bfd9a8 [ruby/openssl] ts: fix exception class raised when getting an OID name
get_asn1obj() is used by several methods in OpenSSL::Timestamp to get
the string representation of an OID. On an error, such as memory
allocation failure, it can raise OpenSSL::X509::AttributeError. It
should be OpenSSL::Timestamp::TimestampError instead.

a424aad1df
2024-12-07 07:55:46 +00:00
Kazuki Yamaguchi
f8e9302e66 [ruby/openssl] ts: avoid using OpenSSL::PKCS7's internals
Internals of OpenSSL::PKCS7 should be kept within ossl_pkcs7.c.

Add a new ossl_pkcs7_new() function for duplicating and wrapping an
OpenSSL PKCS7 object in OpenSSL::PKCS7. This follows the convention
used by other ossl_*_new() functions.

b5f79f771e
2024-12-07 07:55:46 +00:00
Kazuki Yamaguchi
870cce9798 [ruby/openssl] x509store: fix exception class in OpenSSL::X509::StoreContext#verify
Follow-up commit 0789643d73 (openssl: clear OpenSSL error
queue before return to Ruby, 2016-05-18). It should raise
OpenSSL::X509::StoreError instead of OpenSSL::X509::CertificateError.

0201f23ad6
2024-12-07 07:55:46 +00:00
Kazuki Yamaguchi
3656c1db29 [ruby/openssl] ns_spki: fix exception class in OpenSSL::Netscape::SPKI#to_der
It should raise OpenSSL::Netscape::SPKIError instead of
OpenSSL::X509::CertificateError.

No test cases covered this because it only occurs in exceptional
cases, such as memory allocation failure.

527b6101d1
2024-12-07 07:55:45 +00:00
Kazuki Yamaguchi
b207b956c1 [ruby/openssl] pkey/ec: fix exception class in OpenSSL::PKey::EC.new
Fix a copy-and-paste error introduced in commit 74f6c61756 (pkey:
allocate EVP_PKEY on #initialize, 2021-04-12).

It should raise OpenSSL::PKey::ECError instead of
OpenSSL::PKey::DSAError.

b1f6a04abf
2024-12-07 07:55:45 +00:00
HoneyryderChuck
5444885726 [ruby/openssl] make configs shareable when frozen
654cb22e21
2024-12-07 07:52:02 +00:00
HoneyryderChuck
9cae90f9d7 [ruby/openssl] freeze OpenSSL::Config::DEFAULT_CONFIG_FILE
3cc1825435
2024-12-07 07:52:01 +00:00
HoneyryderChuck
2a006fe54b [ruby/openssl] make config frozen on initialize
50599513cf
2024-12-07 07:52:01 +00:00
Kazuki Yamaguchi
06fc13a15c [ruby/openssl] ssl: handle callback exceptions in SSLSocket#sysread and #syswrite
Check the ID_callback_state ivar after SSL_read() or SSL_write()
returns, similar to what ossl_start_ssl() does.

Previously, callbacks that can raise a Ruby exception were only called
from ossl_start_ssl(). This has changed in OpenSSL 1.1.1. Particularly,
the session_new_cb will be called whenever a client receives a
NewSessionTicket message, which can happen at any time during a TLS 1.3
connection.

aac9ce1304
2024-12-07 07:37:32 +00:00
Kazuki Yamaguchi
19acb3af2e [ruby/openssl] ssl: fix potential exception in servername_cb
ssl_servername_cb() is a callback function called from OpenSSL and Ruby
exceptions must not be raised from it. Allocate the Array within
rb_protect().

3a2bf74d35
2024-12-07 07:36:19 +00:00
Stan Lo
8ad6860ff7
[DOC] New homepage for docs.ruby-lang.org/en (#12227) 2024-12-06 13:51:08 -05:00
Alan Wu
97e93af541 .gdbinit: Fix reference to undefined rb_thread_t field [ci skip] 2024-12-06 12:27:03 -05:00
Maxime Chevalier-Boisvert
8502a549ef
YJIT: small fix to stats formatting. (#12282)
Avoid division by zero and NaN%, e.g.
num_throw_break:                   0 ( NaN%)
num_throw_retry:                   0 ( NaN%)
num_throw_return:                  0 ( NaN%)
2024-12-06 09:25:39 -08:00
Peter Zhu
c45503f957 Add rb_gc_impl_active_gc_name to gc/gc_impl.h 2024-12-06 10:22:03 -05:00
David Rodríguez
48443c0204 [rubygems/rubygems] Skip unresolved deps warning on Gem::Specification.reset on benign cases
If `Gem::Specification.reset` is used, but there are still unresolved
dependencies, RubyGems prints a warning. There are though, certain cases
where the situation will not cause any issues.

One such case is when the unresolved dependency does not restrict any
versions (>= 0) and there's a default gem matching it.

In this situation, it doesn't matter if Gem paths change, because
default gems are still activatable, so the dependency will be properly
activated if ever needed.

e5f8a3068e
2024-12-06 15:19:19 +00:00
David Rodríguez
ba91ff5f78 [rubygems/rubygems] Make sure unresolved deps are properly cleared by Gem::Specification.reset
3976326a7b
2024-12-06 15:19:19 +00:00
Nobuyoshi Nakada
78614ee900
CI: Clean up intermediate files more 2024-12-06 21:47:35 +09:00
Nobuyoshi Nakada
3901df708d
[DOC] Move GC.config news
To "Core classes updates" from "Language changes".
2024-12-06 21:12:57 +09:00
Nobuyoshi Nakada
0fac583d52
[DOC] Fix a typo 2024-12-06 21:12:57 +09:00
Nobuyoshi Nakada
efaea5a62e
[DOC] Adjust the link to Kernel method
RDoc displays instance methods defined in `Kernel` as in `Object`.
This behavior may be somewhat questionable now, but for now it is what
it is.
2024-12-06 21:12:57 +09:00
Nobuyoshi Nakada
bf49ff95be
[DOC] Fix class and method links
Make existing (including newly added) classes, modules and methods
linkable.  Oppositely enclose removed names in backticks.
2024-12-06 21:12:57 +09:00
Hiroshi SHIBATA
69fb4a5f38
typeprof-757303fe8de0cf5e5583b4a76f8abbbd55c44776 is working with Windows 2024-12-06 20:01:37 +09:00
Nobuyoshi Nakada
cb8625e81b
[Bug #20929] NEWS for Time#zone encoding change on Windows 2024-12-06 19:40:56 +09:00
Nobuyoshi Nakada
1c15f641cc [Bug #20929] Win32: Encode timezone name in UTF-8 2024-12-06 18:59:38 +09:00
Nobuyoshi Nakada
78762b5218 [Bug #20929] Fix assert_zone_encoding
The default internal encoding is not taken into account to encode
timezone name.
2024-12-06 18:59:38 +09:00
Matt Valentine-House
58b4e249ed [MMTk/CI] Skip Ractor btests with MMTk
currently these are flaky, so until we can make them more robust, we'll
skip them for MMTk CI
2024-12-06 09:48:30 +00:00
Matt Valentine-House
7caf2ffe00 Remove the GC build check in Ubuntu.yml 2024-12-06 09:48:30 +00:00
Matt Valentine-House
ffb26a53d1 Add Modular GC (default, MMTk) builds to CI 2024-12-06 09:48:30 +00:00
tomoya ishida
5f65321915 [ruby/reline] Combine MAPPINGS(single byte input to symbol) with
key_bindings(escape sequence to symbol)
(https://github.com/ruby/reline/pull/715)

6a7e249374
2024-12-06 07:09:24 +00:00
ydah
6ccaa37eb3 [Bug #20926] Fix a crashes with shareable_constant_value: experimental_everything using parse.y's parser
https://bugs.ruby-lang.org/issues/20926
2024-12-06 12:32:20 +09:00
dependabot[bot]
af2fc89f9f Bump actions/cache in /.github/actions/setup/directories
Bumps [actions/cache](https://github.com/actions/cache) from 4.1.2 to 4.2.0.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](6849a64899...1bd1e32a3b)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-06 12:04:10 +09:00
Kazuhiro NISHIYAMA
892c46283a
[DOC] Sort links [ci skip] 2024-12-06 11:41:45 +09:00
Hiroshi SHIBATA
81c24b3c29 We need to specify --with-opt-dir for jemalloc installation path 2024-12-06 10:31:16 +09:00
Hiroshi SHIBATA
0b5d6c80ba Added -with-gmp build to macOS 2024-12-06 10:31:16 +09:00
Hiroshi SHIBATA
bc214d10b8 Added jemalloc build to GitHub Actions 2024-12-06 10:31:16 +09:00
Randy Stauner
b021f6f8a7
Use symbol.h in vm.c to get macro for faster ID to sym (#12272)
The macro provided by symbol.h uses STATIC_ID2SYM
when it can which speeds up methods that declare keyword args.

Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
Co-authored-by: Takashi Kokubun (k0kubun) <takashikkbn@gmail.com>
Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>
Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2024-12-05 17:51:32 -05:00
Peter Zhu
eedb30d385 Use rb_gc_enable/rb_gc_disable_no_rest instead of ruby_disable_gc
We should use the rb_gc_enable/rb_gc_disable_no_rest APIs instead of
directly setting the ruby_disable_gc variable.
2024-12-05 16:21:37 -05:00
Matt Valentine-House
d4fb966186 [ruby/mmtk] Add MMTk test exclusions for Ruby CI
f62e5803f1
2024-12-05 20:12:45 +00:00
Peter Zhu
7ccad5b9f8 darray.h does not depend on internal/bits.h
darray.h no longer depends on internal/bits.h, so we can remove it.
2024-12-05 14:12:56 -05:00
Samuel Giddins
305318edbb [rubygems/rubygems] Apply suggestions from code review
7c634ecd72
2024-12-05 19:00:44 +00:00
Samuel Giddins
7daf85bdf2 [rubygems/rubygems] Stop storing executable names in ivars
Removes usage of these classes as ACE gadgets

See https://nastystereo.com/security/ruby-3.4-deserialization.html

Signed-off-by: Samuel Giddins <segiddins@segiddins.me>

89ad04db86
2024-12-05 19:00:44 +00:00
Aaron Patterson
6877c38866 [ruby/prism] Fix error messages for unterminated ( and {
If we hit an EOF token, and the character before the EOF is a newline,
we should make EOF token start at the previous newline.  That way any
errors reported will occur on that line.

For example "foo(\n" should report an error on line 1 even though the
EOF technically occurs on line 2.

[Bug #20918]
https://bugs.ruby-lang.org/issues/20918

60bc43de8e
2024-12-05 18:42:01 +00:00
Matt Valentine-House
d8dbc2dcba [ruby/mmtk] Support setting the mmtk thread count with MMTK_THREADS
e4d6b56824
2024-12-05 16:28:02 +00:00
Peter Zhu
ce1ad1b816 Standardize on the name "modular GC"
We have name fragmentation for this feature, including "shared GC",
"modular GC", and "external GC". This commit standardizes the feature
name to "modular GC" and the implementation to "GC library".
2024-12-05 10:33:26 -05:00
Stan Lo
26ab20fec1 [ruby/rdoc] Workaround JRuby's jar-dependencies error and test
failures on CI
(https://github.com/ruby/rdoc/pull/1225)

* Workaround JRuby's jar-dependencies error on CI

* Skip problematic encoding test for JRuby

3f9897d64c
2024-12-05 12:31:51 +00:00
Stan Lo
2ecd2fe0ed [ruby/rdoc] Deprecate main and title directives
(https://github.com/ruby/rdoc/pull/1218)

* Deprecate :main: directive

* Deprecate :title: direcive

* Update documentation

* Remove :main: directive's usage

* Update test cases

* Add '.rdoc_options' to suggested alternatives

e2d4ac9dad
2024-12-05 11:36:34 +00:00
Naoto Ono
866f1a1f2d
Launchable: Stop recording tests temporarily (#12268)
There is a system trouble in Launchable, so I'm going to stop recording tests temporarily in compilers.yaml
2024-12-05 17:58:46 +09:00
git
4336f413b5 Update default gems list at 811bc15c75 [ci skip] 2024-12-05 08:17:20 +00:00
Jean Boussier
5335b140ab array.c: Remove unused rb_ary_verify function 2024-12-05 09:16:31 +01:00