summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2025-07-23ZJIT: Fix clobbering register for `self` in gen_entry_params()Alan Wu
Previously, for 8+ params we wound up clobbering the self param when putting the last param in memory in the JIT entry point: # ZJIT entry point: a@../test.rb:5 <snip> ldur x0, [x19, #0x18] # set method params: 8 ldur x1, [x21, #-0x58] ldur x2, [x21, #-0x50] ldur x3, [x21, #-0x48] ldur x4, [x21, #-0x40] ldur x5, [x21, #-0x38] ldur x11, [x21, #-0x30] ldur x12, [x21, #-0x28] ldur x0, [x21, #-0x20] stur x0, [sp, #-0x20] bl #0x11e17018c Doing the memcpys for parameters in memory first avoids this clobbering. # set method params: 8 ldur x0, [x21, #-0x20] stur x0, [sp, #-0x20] ldur x12, [x21, #-0x28] ldur x11, [x21, #-0x30] ldur x5, [x21, #-0x38] ldur x4, [x21, #-0x40] ldur x3, [x21, #-0x48] ldur x2, [x21, #-0x50] ldur x1, [x21, #-0x58] ldur x0, [x19, #0x18]
2025-07-22[ruby/openssl] ssl: add SSLSocket#sigalg, #peer_sigalg, #groupJun Aruga
These methods are useful to test post-quantum cryptography (PQC) cases. https://github.com/ruby/openssl/commit/434ef74452
2025-07-22Interpolated strings must not be frozenAaron Patterson
Strings concatenated with backslash may end up being frozen when they shouldn't be. This commit fixes the issue. It required a change upstream in Prism, but also a change to the Prism compiler in CRuby. https://github.com/ruby/prism/pull/3606 [Bug #21187]
2025-07-22[rubygems/rubygems] Define dummy module for mise pluginHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/64bdff1e1e
2025-07-21ZJIT: Load return value before frame teardownAlan Wu
Or else the following returns garbage since it loads after moving SP. Prior bad disassembly: def a(n1,n2,n3,n4,n5,n6,n7,n8) = n8 a(1,1,1,1,1,1,1,0) # Block: bb0(v0, v1, v2, v3, v4, v5, v6, v7, v8) stp x29, x30, [sp, #-0x10]! mov x29, sp # bump C stack pointer sub sp, sp, #0x10 # Insn: v10 Return v8 # pop stack frame adds x19, x19, #0x38 stur x19, [x20, #0x10] # restore C stack pointer add sp, sp, #0x10 mov sp, x29 ldp x29, x30, [sp], #0x10 ldur x0, [sp] ret
2025-07-22Revert "[ruby/prism] Clear flags on interpolated strings"Hiroshi SHIBATA
This reverts commit a495e6a44ce8cff17461b250e32ab63e409a642d. This break extension builds: ``` /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:321:in 'String#replace': can't modify frozen String: "$(SDKROOT)$(prefix)/include" (FrozenError) from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:321:in 'RbConfig.expand' from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:314:in 'block in RbConfig.expand' from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:307:in 'String#gsub' from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:307:in 'RbConfig.expand' from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:314:in 'block in RbConfig.expand' from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:307:in 'String#gsub' from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:307:in 'RbConfig.expand' from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:314:in 'block in RbConfig.expand' from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:307:in 'String#gsub' from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:307:in 'RbConfig.expand' from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:325:in 'block in <module:RbConfig>' from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:324:in 'Hash#each_value' from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:324:in '<module:RbConfig>' from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:11:in '<top (required)>' from ./ext/extmk.rb:42:in 'Kernel#require' from ./ext/extmk.rb:42:in '<main>' make[1]: *** [ext/configure-ext.mk:70: ext/json/exts.mk] Error 1 ```
2025-07-21[ruby/prism] Clear flags on interpolated stringsAaron Patterson
When inner strings aren't frozen, we need to clear the flags on interpolated string nodes so that we don't emit wrong instructions. The compiler is currently incorrectly emitting frozen strings because the parser is erroneously declaring interpolated strings as "frozen". We need to fix this behavior in the parser so we can fix the compiler in CRuby. This patch is a partial fix for [this bug](https://bugs.ruby-lang.org/issues/21187) https://github.com/ruby/prism/commit/eda693f056
2025-07-21[ruby/openssl] test/openssl/test_ts.rb: make assert_raise blocks smallerKazuki Yamaguchi
https://github.com/ruby/openssl/commit/dbfcc44b37
2025-07-21[ruby/openssl] test/openssl/test_ossl.rb: fix style issuesKazuki Yamaguchi
Use OpenSSL::TestCase instead of OpenSSL::SSLTestCase. Prefer assert_true and assert_false over the bare assert and refute. OpenSSL.fixed_length_secure_compare and OpenSSL.secure_compare will only return true or false, and it should be checked. https://github.com/ruby/openssl/commit/3d9938ed40
2025-07-21[ruby/openssl] Move slow tests to OSSL_TEST_ALL=1 onlyKazuki Yamaguchi
Update GitHub Actions workflows to set OSSL_TEST_ALL=1. Exclude a few slow tests that are not critical for local development, unless OSSL_TEST_ALL=1 is set. The bindings code paths are still reached by other tests with smaller inputs, and failures in those would likely indicate an issue in OpenSSL rather than in the bindings. Newly excluded tests include generating large DSA keys and measuring CRYPTO_memcmp() timing. These tests currently take nearly half of the total runtime. https://github.com/ruby/openssl/commit/382eca2aec
2025-07-19[ruby/fileutils] Just the parent path of the destination symlink should existNobuyoshi Nakada
https://github.com/ruby/fileutils/commit/71225b1b46
2025-07-19[ruby/fileutils] FileUtils.remove_dir checks directoryErik Berlin
https://github.com/ruby/fileutils/commit/f0d7fc817b
2025-07-19[ruby/fileutils] Use shorter symlink by real pathsNobuyoshi Nakada
https://github.com/ruby/fileutils/commit/277f7f2ff8
2025-07-19[ruby/fileutils] Fix up `FileUtils#ln_sr`Nobuyoshi Nakada
https://github.com/ruby/fileutils/commit/2836a164ed
2025-07-18ZJIT: Support invalidating on method redefinition (#13875)Stan Lo
ZJIT: Support invalidating method redefinition This commit adds support for the MethodRedefined invariant to be invalidated when a method is redefined. Changes: - Added CME pointer to the MethodRedefined invariant in HIR - Updated all places where MethodRedefined invariants are created to include the CME pointer - Added handling for MethodRedefined invariants in gen_patch_point to call track_cme_assumption, which registers the patch point for invalidation when rb_zjit_cme_invalidate is called This ensures that when a method is redefined, all JIT code that depends on that method will be properly invalidated.
2025-07-18[ruby/fileutils] Fix `ln_sf` with multiple sources and `target_directory: false`Nobuyoshi Nakada
In this case, an ArgumentError is now raised rather than ignoring the option, just as GNU coreutils' `ln` would error on the command line. Fixes https://github.com/ruby/fileutils/pull/128 as well. https://github.com/ruby/fileutils/commit/4fc578a75f
2025-07-18Revert "[Bug #21256] Fix `it` parameter when splatting and `define_method` ↵Yusuke Endoh
is…" This reverts commit 265059603c3aa6a13f90096c71b32046a17938f3.
2025-07-17ZJIT: Fix fixnum folding for negative values (#13942)Stan Lo
Use `fixnum_from_isize` instead of `fixnum_from_usize` in `fold_fixnum_bop` to properly handle negative values. Casting negative `i64` to `usize` produces large unsigned values that exceed `RUBY_FIXNUM_MAX`.
2025-07-17Fix compilation for forwarding params in PrismAaron Patterson
[Bug #21326]
2025-07-17[Bug #21256] Fix `it` parameter when splatting and `define_method` is usedEarlopain
It was failing to set the leads, like numblocks do, causing the result to be wrapped in an array
2025-07-17ZJIT: Give up JIT-to-JIT calls for 6+ args (#13939)Takashi Kokubun
2025-07-17[ruby/prism] Revert "Merge pull request #3598 from Shopify/fix-3473"Aaron Patterson
This reverts commit https://github.com/ruby/prism/commit/bc446fb9795e, reversing changes made to https://github.com/ruby/prism/commit/71432af1eb49. https://github.com/ruby/prism/commit/e5ca485f4e
2025-07-17[ruby/prism] Allow command calls in endless method bodies regardless of contextStan Lo
Previously, endless method definitions like `x = def f = p 1` would fail to parse because command calls (method calls without parentheses) were only accepted when the surrounding binding power was less than `PM_BINDING_POWER_COMPOSITION` (8). In assignment contexts with binding power 18, this condition was false, causing parse errors. This fix ensures command calls are always accepted in endless method bodies by passing `true` for `accepts_command_call`, making the method body parse consistently regardless of where the method is defined. https://github.com/ruby/prism/commit/70413ed4dd
2025-07-17[Feature #21347] Add `open_timeout` as an overall timeout option for ↵Misaki Shioi
`TCPSocket.new` (#13909) * [Feature #21347] Add `open_timeout` as an overall timeout option for `TCPSocket.new` With this change, `TCPSocket.new` now accepts the `open_timeout` option. This option raises an exception if the specified number of seconds has elapsed since the start of the method call, even if the operation is still in the middle of name resolution or connection attempts. The addition of this option follows the same intent as the previously merged change to `Socket.tcp`. [Feature #21347](https://bugs.ruby-lang.org/issues/21347) https://github.com/ruby/ruby/pull/13368 * Tidy up: Extract rsock_raise_user_specified_timeout() * Added a note to the documentation of `Socket.tcp` * Fix `rsock_init_inetsock` for `FAST_FALLBACK_INIT_INETSOCK_IMPL`
2025-07-17[rubygems/rubygems] Restore treating "--" as an unknown platformDavid Rodríguez
Rather than crashing when parsing it. https://github.com/rubygems/rubygems/commit/aa0064e4c7
2025-07-16ZJIT: Remove unneeded test exclusionsStan Lo
After several ZJIT fix PRs, the number of failing/crashing tests for ZJIT has dropped significantly. This removes the unneeded test exclusions.
2025-07-16ZJIT: Split shift with immediate operand (#13914)Max Bernstein
Fix https://github.com/Shopify/ruby/issues/627
2025-07-16[ruby/prism] [Bug #21345] Fix accepting multiple rest patterns with leading ↵Earlopain
match Related: * https://bugs.ruby-lang.org/issues/20765 * https://github.com/ruby/prism/issues/2915 https://github.com/ruby/prism/commit/de56fa4a34
2025-07-16test_process.rb: UID.from_name may raise Errno::ENOENTTakashi Kokubun
See: 58bc97628c1 getpwnam(3) says the same thing. I got ENOENT in my Linux environment. 1) Failure: TestProcess#test_uid_from_name [/home/k0kubun/src/github.com/ruby/ruby/test/ruby/test_process.rb:1685]: Exception(ArgumentError) with message matches to /\u{4e0d 5b58 5728}/. [ArgumentError] exception expected, not #<Errno::ENOENT: No such file or directory - getpwnam_r>.
2025-07-16[ruby/prism] Fix crash when using arithmetic expressions in pattern matchingStan Lo
When arithmetic expressions like `-1**2` are used in pattern matching contexts, Ruby crashes with "Unexpected node type in pattern matching expression: PM_CALL_NODE". This happens because the Prism parser creates `PM_CALL_NODE` for arithmetic operations, but Ruby's pattern matching compiler doesn't handle call nodes. This fix adds validation to reject `PM_CALL_NODE` in pattern contexts with a proper syntax error. https://github.com/ruby/prism/commit/365049a767
2025-07-16ZJIT: Fix SP alignment on JIT entry for x86_64Takashi Kokubun
2025-07-16[ruby/prism] Improve error handling for missing parentheses after 'not' in ↵ydah
command calls https://github.com/ruby/prism/commit/d9151b8a82
2025-07-16[ruby/prism] Reject `true && not true`Yusuke Endoh
A command-call-like `not true` must be rejected after `&&` and `||`. https://bugs.ruby-lang.org/issues/21337 https://github.com/ruby/prism/commit/0513cf22ad
2025-07-16`test_defined_paren_void_stmts` passes with parse.y nowNobuyoshi Nakada
2025-07-15ZJIT: Start testing against `/test/ruby/` and update all ZJIT related ↵Stan Lo
testing targets/docs (#13791) * ZJIT: Add test exclusions for ZJIT * ZJIT: Update test targets and documentation - Rename `zjit-test-all` to `zjit-check` - Add `zjit-test-all` target to zjit.mk to run all Ruby tests with ZJIT enabled excluding known failing tests - Update documentation and CI workflow to reflect the new targets
2025-07-15ZJIT: Add failing test to test_spilled_method_args()Alan Wu
2025-07-16Suppress warnings for variablesNobuyoshi Nakada
2025-07-15Skip `URI::TestMailTo#test_email_regexp` for nowNobuyoshi Nakada
2025-07-14ZJIT: Restore SP register after JIT-to-JIT call (#13882)Takashi Kokubun
Co-authored-by: Alan Wu <alansi.xingwu@shopify.com> Co-authored-by: Stan Lo <stan.lo@shopify.com>
2025-07-14[rubygems/rubygems] Fix more warnings when running old Bundler with latest ↵David Rodríguez
RubyGems Also fix platform warnings when Bundler's entrypoint is bundler's binstub. https://github.com/rubygems/rubygems/commit/4b1df58403
2025-07-14[rubygems/rubygems] Improve some heredoc indentationsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/6ee3a33048
2025-07-14[rubygems/rubygems] Stop generating binstubs with support for RubyGems ↵David Rodríguez
before 2.6.2 RubyGems generated binstubs still provide support for this ancient version. This makes no sense since we prevent downgrades to such old versions. https://github.com/rubygems/rubygems/commit/089cdc3b77
2025-07-13[ruby/uri] Repeat matching to reduce deviationsNobuyoshi Nakada
https://github.com/ruby/uri/commit/fa49e5b8ae
2025-07-13[ruby/uri] Test in exponential scale with rehearsalNobuyoshi Nakada
https://github.com/ruby/uri/commit/be35e0b4d8
2025-07-12[ruby/openssl] asn1: align UTCTime year range with RFC 5280Kazuki Yamaguchi
ASN.1 UTCTime uses two-digit years. While X.680 does not specify how to map them as far as I can tell, X.509/PKIX uses this type to represent dates between year 1950-2049. OpenSSL::ASN1.decode has used 1969-2068 since the initial implementation. Given that ASN1::UTCTime#to_der relies on OpenSSL ASN1_UTCTIME type, which assumes the 1950-2049 range, this was likely unintentional. Use the range 1950-2049 consistently, and fix decoding of X.509 certificates with dates in 1950-1968. https://github.com/ruby/openssl/commit/b8b38e1438
2025-07-12[ruby/uri] Improve performance of `URI::MailTo::EMAIL_REGEXP`Nobuyoshi Nakada
Fix the performance regression at #172 for valid emails. ``` yml prelude: | require 'uri/mailto' n = 1000 re = URI::MailTo::EMAIL_REGEXP benchmark: n.t..t.: re.match?("n.t..t.@docomo.ne.jp") example: re.match?("example@example.info") ``` | |released| 788274b| c5974f0| this| |:--------|-------:|-------:|-------:|-------:| |n.t..t. | 3.795M| 4.864M| 4.993M| 8.739M| | | -| 1.28x| 1.32x| 2.30x| |example | 3.911M| 3.740M| 2.838M| 3.880M| | | 1.38x| 1.32x| -| 1.37x| https://github.com/ruby/uri/commit/7363a134ac
2025-07-12[ruby/uri] Do not allow empty host names, as they are not allowed by RFC 3986Jeremy Evans
Pointed out by John Hawthorn. Fixes [Bug #20686] https://github.com/ruby/uri/commit/c0cfa04a66
2025-07-12[ruby/uri] Prohibit successive dots in emailNobuyoshi Nakada
https://github.com/ruby/uri/commit/32335923bf
2025-07-12[ruby/uri] More tests for `check_to`Nobuyoshi Nakada
https://github.com/ruby/uri/commit/b1b5f9a476
2025-07-12[ruby/uri] lib/uri/mailto.rb (EMAIL_REGEXP): use assertions surrounding the ↵Nikita Levchuk
local part instead of a character class https://github.com/ruby/uri/commit/2d7d2d9988