90410 Commits

Author SHA1 Message Date
Hiroshi SHIBATA
fc60a04de9 [ruby/cgi] Use String#concat instead of String#+ for reducing cpu usage
https://github.com/ruby/cgi/commit/9907b76dad

Co-authored-by: "Yusuke Endoh" <mame@ruby-lang.org>
2025-02-26 07:34:03 +00:00
git
aa31c893a2 Update default gems list at eac8b1197f65162233465e1c32e2ce [ci skip] 2025-02-26 07:13:57 +00:00
Hiroshi SHIBATA
eac8b1197f [ruby/uri] Bump up v1.0.3
https://github.com/ruby/uri/commit/3213f4a0f8
2025-02-26 07:12:53 +00:00
Hiroshi SHIBATA
b407b6b5b2 [ruby/uri] Fix merger of URI with authority component
https://hackerone.com/reports/2957667

https://github.com/ruby/uri/commit/2789182478

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2025-02-26 07:08:45 +00:00
Hiroshi SHIBATA
57dcb4bb9b [ruby/uri] Truncate userinfo with URI#join, URI#merge and URI#+
https://github.com/ruby/uri/commit/3675494839
2025-02-26 07:08:44 +00:00
git
7d24e1d655 Update default gems list at ae0853b5f5f4bf78c2bd9e34cad6e5 [ci skip] 2025-02-26 06:21:38 +00:00
Hiroshi SHIBATA
ae0853b5f5 [ruby/cgi] Bump up 0.4.2.beta1
https://github.com/ruby/cgi/commit/3f5b4ed9e9
2025-02-26 06:20:36 +00:00
Naoto Ono
0c9f149b4d
Launchable: Fix launchable record session command failures (#12810)
Currently, the `launchable record session` command is failing some workflows such as YJIT on macOS. This occurs because of word splitting, as explained in https://www.shellcheck.net/wiki/SC2086. This PR addresses the issue.

```
+ launchable record session --build refs_pull_12785_merge_5ac818aaf7402e232de6b3e1b078765da3dc6279 --observation --flavor os=macos-14 --flavor test_task=check --flavor test_opts=--enable-yjit --flavor workflow=YJIT macOS Arm64 --test-suite yjit-test-all
Usage: launchable record session [OPTIONS]
Try 'launchable record session --help' for help.

Error: Got unexpected extra arguments (macOS Arm64)
Error: Process completed with exit code 2.
```

https://github.com/ruby/ruby/actions/runs/13535324545/job/37825826044#step:10:354
2025-02-26 03:50:54 +00:00
Nobuyoshi Nakada
14192921f5
Check LoadError first
The message from dlerror is not our concern.
2025-02-26 11:13:41 +09:00
Hiroshi SHIBATA
2194e65a98
Added assertion strings with Xcode 16.3 beta 2025-02-26 09:09:56 +09:00
Koichi ITO
6efd15a128 [ruby/prism] Restore a comment for Prism::Translation::Parser#initialize
This restores the missing method comments in https://github.com/ruby/prism/pull/3479.

https://github.com/ruby/prism/commit/78b8f67dee
2025-02-25 22:18:02 +00:00
Earlopain
044570fd76 [ruby/prism] Fix merge mishap
Caused by https://github.com/ruby/prism/pull/3478 and https://github.com/ruby/prism/pull/3443

I also made the builder reference more explicit to clearly distinquish
between `::Parser` and `Prism::Translation::Parser`

https://github.com/ruby/prism/commit/d52aaa75b6
2025-02-25 17:11:39 +00:00
Earlopain
790b3858e8 [ruby/prism] Add a custom builder class for the parser translator
I want to add new node types to the parser translator, for example `itblock`. The bulk of the work is already done by prism itself. In the `parser`
builder, this would be a 5-line change at most but we don't control that here.

Instead, we can add our own builder and either overwrite the few methods we need,
or just inline the complete builder. I'm not sure yet which would be better.

`rubocop-ast` uses its own builder for `parser`. For this to correctly work, it must explicitly choose to extend the
prism builder and use it, same as it currently chooses to use a different parser when prism is used.

I'd like to enforce that the builder for prism extends its custom one since it will lead to
some pretty weird issues otherwise. But first, I'd like to change `rubocop-ast` to make use of this.

https://github.com/ruby/prism/commit/b080e608a8
2025-02-25 15:44:56 +00:00
Koichi ITO
2c3d2415d1 [ruby/prism] Support custom parser in Prism::Translation::Parser
Follow-up to https://github.com/Shopify/ruby-lsp/pull/1849.

This is an extension of `Prism::Translation::Parser` to implement https://github.com/Shopify/ruby-lsp/pull/1849.
It is based on the comments in https://github.com/Shopify/ruby-lsp/pull/1849#pullrequestreview-1966020868,
but also adds a default argument for delegation to `Parser::Base` super class.

Using this API, https://github.com/rubocop/rubocop-ast/pull/359 has been implemented in RuboCop AST.
As detailed in https://github.com/rubocop/rubocop-ast/pull/359, this change is expected to improve performance by 1.3x
for some source code.
Achieving a 1.3x speedup with such this simple modification is a significant improvement for Ruby LSP and its users.

https://github.com/ruby/prism/commit/925725291c
2025-02-25 15:41:29 +00:00
Hiroshi SHIBATA
e0c0e06154 Skip fiddle assertions if fiddle is not available 2025-02-25 15:36:46 +09:00
David Rodríguez
158e4cc4ec [rubygems/rubygems] Improve log message about adding a new platform
This message is printed when running `bundle lock --add-platform`. This
command affects the lockfile, not the gemfile, and I think it's better
to use "You are adding" rather than "You added", because the addition is
happening during the current invocation (as opposed to other log
messages that talk about a change made to the Gemfile prior to running
the command).

https://github.com/rubygems/rubygems/commit/aba1e55f5b
2025-02-25 15:36:46 +09:00
David Rodríguez
5284719273 [rubygems/rubygems] Refactor handling platform removals
And make it consistent with platform additions.

https://github.com/rubygems/rubygems/commit/64342ae404
2025-02-25 15:36:46 +09:00
David Rodríguez
8b952e6489 [rubygems/rubygems] Improve log message when resolving due to local platform not in lockfile
Current it says "you added a new platform to your gemfile", but that's
not actually the case here.

https://github.com/rubygems/rubygems/commit/1e39527a38
2025-02-25 15:36:46 +09:00
Edouard CHIN
71f0c37473 [rubygems/rubygems] Modify bundle doctor to not report issue when files aren't writable:
- ### Problem

  Running `bundle doctor` warn about files that aren't writable.
  This makes the output of `bundle doctor` very verbose for something
  I believe isn't really an issue.

  ### Context

  Rubygems keeps the files original permission at the time the gem
  is packaged.
  Many gem maintainers have decided that the permissions of the files
  in their bundled would be 0444, this includes amongst others:
  minitest, selenium, brakeman...

  Any git gems that had a 0444 permissions at some point in its git
  history would also be reported (as bundle doctor look in the
  `cache/bundler/git/<gem>/object` path).

  While it completely make sense to report when files aren't readable,
  maybe it's worth questioning the usefulness of reporting files
  that can't be written and what problem this causes to the user
  (if any).

  ### Solution

  Removed the check for unwritable file.

  ### Side note

  I also tweaked the "No issues ..." message logic as it was doing
  the opposite (reporting an issue when there is none and vice versa).
  This wasn't caught in tests because as a stub on `Bundler.ui.info`
  was missing.

https://github.com/rubygems/rubygems/commit/9a426b9495
2025-02-25 15:36:46 +09:00
Hiroshi SHIBATA
b7c87ccd79 [rubygems/rubygems] Added fiddle dependency for TestGemExtCargoBuilder
https://github.com/rubygems/rubygems/commit/a7c6696ffd
2025-02-25 15:36:46 +09:00
Andrii Konchyn
ea8b0017b2 [ruby/strscan] Enable tests passing on TruffleRuby
(https://github.com/ruby/strscan/pull/144)

Changes:
- enabled tests passing on TruffleRuby
- removed `truffleruby` and keep only `truffleruby-head` in CI

https://github.com/ruby/strscan/commit/4aadfc8408
2025-02-25 15:36:46 +09:00
NAITOH Jun
018943ba05 [ruby/strscan] Fix a bug that inconsistency of IndexError vs nil for
unknown capture group
(https://github.com/ruby/strscan/pull/143)

Fix https://github.com/ruby/strscan/pull/139

Reported by Benoit Daloze. Thanks!!!

https://github.com/ruby/strscan/commit/bc8a0d2623
2025-02-25 15:36:46 +09:00
NAITOH Jun
36ab247e4d [ruby/strscan] Fix a bug that scanning methods that don't use Regexp
don't clear named capture groups
(https://github.com/ruby/strscan/pull/142)

Fix https://github.com/ruby/strscan/pull/135

https://github.com/ruby/strscan/commit/b957443e20
2025-02-25 15:36:46 +09:00
Samuel Williams
021ccbf7e8 [ruby/pp] Ensure the thread local state is always set up.
(https://github.com/ruby/pp/pull/38)

https://github.com/ruby/pp/commit/5b5d483ac2
2025-02-25 03:38:04 +00:00
Samuel Williams
d32fa5283f
Prefer 0.000001 over 0.000001f for timeout calculations. (#12803) 2025-02-25 16:37:21 +13:00
ydah
3198b46a36 s/TERMINTOR/TERMINATOR/ 2025-02-25 10:29:15 +09:00
BurdetteLamar
8749a131ce [DOC] Tweaks for Hash#include? 2025-02-24 19:27:41 -05:00
BurdetteLamar
0615df2a84 [DOC] Tweaks for Hash#hash 2025-02-24 19:27:31 -05:00
Burdette Lamar
19f7961e46
[DOC] Tweaks for Hash#flatten 2025-02-24 19:26:50 -05:00
Kunshan Wang
aa7b5e2df4 [ruby/mmtk] Trigger forced GC in GC.start
We now use `MMTK::handle_user_collection_request(true, ...)` to force
triggering a GC instead of enabling GC temporarily.

https://github.com/ruby/mmtk/commit/02ef47f818
2025-02-24 23:30:00 +00:00
Jean Boussier
97e6ad49a4 Reuse the backref if it isn't marked as busy.
[Misc #20652]
2025-02-24 18:32:46 +01:00
Jean Boussier
87f9c3c65e String#gsub! Elide MatchData allocation when we know it can't escape
In gsub is used with a string replacement or a map that doesn't
have a default proc, we know for sure no code can cause the MatchData
to escape the `gsub` call.

In such case, we still have to allocate a new MatchData because we
don't know what is the lifetime of the backref, but for any subsequent
match we can re-use the MatchData we allocated ourselves, reducing
allocations significantly.

This partially fixes [Misc #20652], except when a block is used,
and partially reduce the performance impact of
abc0304cb28cb9dcc3476993bc487884c139fd11 / [Bug #17507]

```
compare-ruby: ruby 3.5.0dev (2025-02-24T09:44:57Z master 5cf146399f) +PRISM [arm64-darwin24]
built-ruby: ruby 3.5.0dev (2025-02-24T10:58:27Z gsub-elude-match da966636e9) +PRISM [arm64-darwin24]
warming up....

|                 |compare-ruby|built-ruby|
|:----------------|-----------:|---------:|
|escape           |      3.577k|    3.697k|
|                 |           -|     1.03x|
|escape_bin       |      5.869k|    6.743k|
|                 |           -|     1.15x|
|escape_utf8      |      3.448k|    3.738k|
|                 |           -|     1.08x|
|escape_utf8_bin  |      6.361k|    7.267k|
|                 |           -|     1.14x|
```

Co-Authored-By: Étienne Barrié <etienne.barrie@gmail.com>
2025-02-24 18:32:46 +01:00
Nobuyoshi Nakada
21ac0a3a64
[Bug #21153] Add missing op-assign to top const in command_asgn
It was defined in `arg` only; moved that pattern to `op_asgn` rule to
share it with `command_asgn`.
2025-02-24 23:20:12 +09:00
Étienne Barrié
c27f433d7c Fix RUBY_PAGER in manpage 2025-02-24 10:47:58 +01:00
S-H-GAMELINKS
5cf146399f Merge NODE_LINE and NODE_ENCODING cases in cond0 function
NODE_LINE and NODE_ENCODING cases are used SWITCH_BY_COND_TYPE macro that is same to NODE_INTEGER and other cases.
NODE_LINE and NODE_ENCODING cases can be marge to NODE_INTEGER and other node cases.
2025-02-24 18:44:57 +09:00
Tanaka Akira
dfc2520423 [doc] update Time document. 2025-02-23 10:37:36 +09:00
Samuel Chiang
fd882fb681 [ruby/openssl] test_ssl_session.rb: test adjustments to work with AWS-LC
The SSL SESSION files we were originally testing against use DHE and
SSLv3. AWS-LC happens to have no support for either and we have newer
possible alternatives available, so I've updated the respective
files to use ECDHE-RSA-AES256-SHA with TLS 1.1 and 1.2. I've verified
that these work as expected with all libcryptos we support.

There are also a few SSL session discrepencies in AWS-LC when
compared to OpenSSL.

1. AWS-LC has no support for internal session caching on the
   client-end.
2. AWS-LC supports internal session caching on the server, but
   SSL_get1_session does not return a resumable session with TLS 1.3
   in AWS-LC. Users have to use the SSL_CTX_sess_set_new_cb
   (ctx.session_new_cb in Ruby) to retrieve the resumable session
   ticket.
3. AWS-LC has no current support for external session caching in TLS
   1.3.

https://github.com/ruby/openssl/commit/ca384b8e2f
2025-02-22 15:11:40 +00:00
Samuel Chiang
7a15ba48b5 [ruby/openssl] ssl: account for slight behavioral differences in AWS-LC
There are a few SSL discrepencies in AWS-LC when compared to OpenSSL.

1. AWS-LC has slightly different error messages (in all-caps).
2. AWS-LC has no support for DHE ciphersuites.
3. There are no concepts of SSL security levels within AWS-LC.
4. Similar to LibreSSL, there is no support for OPENSSL_CONF.

https://github.com/ruby/openssl/commit/a60d050342
2025-02-22 15:11:40 +00:00
Samuel Chiang
4ec0e9e25d [ruby/openssl] pkey/ec: AWS-LC disallows serialization of explicit curves
https://github.com/ruby/openssl/commit/65c5a772ea
2025-02-22 15:11:40 +00:00
Samuel Chiang
23465d8446 [ruby/openssl] pkey/dh: tweak break tests for AWS-LC
We reecently tweaked some break tests in test_pkey_dh.rb due to
different behavior with OpenSSL in FIPS mode.
AWS-LC does not inherit the same specific behavior, so tests
have been adjusted accordingly.

https://github.com/ruby/openssl/commit/3117897dbc
2025-02-22 15:11:39 +00:00
Samuel Chiang
841d9f259d [ruby/openssl] pkey: EVP_DigestVerify doesn't return -1 in AWS-LC
EVP_DigestVerify in OpenSSL returns 0 to indicate a signature
verification failure and can return -1  to indicate other
failures, such as invalid ASN1 contents. ruby/openssl also
reflects that by returning false with 0 and raising an error
with -1.
EVP_DigestVerify in AWS-LC simply returns 0 for any failure.

https://github.com/ruby/openssl/commit/be8ba76dc1
2025-02-22 15:11:39 +00:00
Samuel Chiang
f63a123606 [ruby/openssl] pkey: AWS-LC disallows parsing of invalid keys and params
OpenSSL allows invalid EC keys or DH params to be parsed. The consuming
application can then run parameter/key checks to check the validity of
the parameters. We happen to run tests to verify that this behaves as
expected.
AWS-LC on the other hand, directly raises an error and disallows the
invalid state to be parsed, rather than making it parsable and checking
the validity later. Relevant tests have been adjusted accordingly to
reflect this.

https://github.com/ruby/openssl/commit/febe50be1b
2025-02-22 15:11:38 +00:00
Samuel Chiang
6263d0d16b [ruby/openssl] test_pkcs7.rb: skip AWS-LC's unsupported features
1. AWS-LC has no support for SMIME with PKCS7. That may change in the
   near future, so I've marked that with "pend" for now.
2. AWS-LC doesn't support printing of PKCS7 contents with
   PKCS7_print_ctx.
3. OpenSSL traditionally used indefinite-length encoding with
   ASN1_TFLG_NDEF in its implementation for PKCS7 EncryptedContent.
   AWS-LC uses explicit OCTET STRING headers to encode instead,
   which leads to a slight difference in serialized ASN1 contents
   from the two libraries.

https://github.com/ruby/openssl/commit/78c585a9c2
2025-02-22 15:11:38 +00:00
Samuel Chiang
b995eee811 [ruby/openssl] asn1: adjusting an ASN1 test to use CONTEXT_SPECIFIC
AWS-LC's ASN1 parsing capabilities led to us examine some of our
ASN1 tests. One test in test_asn1.rb happens to use a tag number
of 8224. There are concerns with larger UNIVERSAL tags being
ambiguous with negative ASN1 Integers, so I've adjusted the test
to use CONTEXT_SPECIFIC instead with the same tag number (8224).

https://github.com/ruby/openssl/commit/c73d9985ab
2025-02-22 15:11:38 +00:00
Samuel Chiang
c4a39d6ebc [ruby/openssl] test_config.rb: skip AWS-LC's unsupported features
AWS-LC has a few minor functionalities removed from NCONF_get_string.

1. Expanding of $foo to a previously-parsed value was removed.
2. OpenSSL falls back to using "default" with an unknown "section".
   AWS-LC does not support this behavior.
3. AWS-LC does not support parsing environment variables with "ENV"
   like LibreSSL.

https://github.com/ruby/openssl/commit/e8de3bbd1e
2025-02-22 15:11:37 +00:00
Samuel Chiang
ee5af8860f [ruby/openssl] test_bn.rb: AWS-LC does not support BN::CONSTTIME
AWS-LC does not support BN_FLG_CONSTTIME due to its historically
inconsistent constant-time guarantees.

https://github.com/ruby/openssl/commit/9875a01b5f
2025-02-22 15:11:37 +00:00
Samuel Chiang
f14995e212 [ruby/openssl] test_pkcs12.rb: don't use KEY_EX/SIG with AWS-LC
AWS-LC does not support the KEY_SIG or KEY_EX flags that were only ever
supported by old MSIE.

https://github.com/ruby/openssl/commit/d50528b4e2
2025-02-22 15:11:37 +00:00
Samuel Chiang
6f3bd3769b [ruby/openssl] test_fips.rb: account for AWS-LC's FIPS mode
AWS-LC's FIPS mode is decided at compile time. FIPS in AWS-LC can't be
toggled on and off like OpenSSL, so tests that attempt to do so are
incompatible.

https://github.com/ruby/openssl/commit/027de6732d
2025-02-22 15:11:36 +00:00
Nobuyoshi Nakada
d6f44535c6
[DOC] Fix a typo 2025-02-22 19:14:33 +09:00
Tanaka Akira
b17f984e4e [doc] Time class document updated. 2025-02-22 10:29:37 +09:00