summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-08-17[DOC] Add `$;` to the list of deprecated global variablesNeil Carvalho
Notes: Merged: https://github.com/ruby/ruby/pull/11392 Merged-By: nobu <[email protected]>
2024-08-17Update bundled gems list as of 2024-08-16git
2024-08-16Revert "Avoid hash allocation for certain proc calls"Jeremy Evans
This reverts commit abc04e898b627ab37fa9dd5e330f239768778d8b. This caused problems in a Rails test. Notes: Merged: https://github.com/ruby/ruby/pull/11394
2024-08-16Fix assertion error when TracePoint has incompatible eventsPeter Zhu
TracePoints with incompatible events (i.e. events not in ISEQ_TRACE_EVENTS) with a method target will fail an assertion error because it does not filter for the supported events. For example, the following lines will cause an assertion error: def foo; end # No arguments passed into TracePoint.new enables all ISEQ_TRACE_EVENTS TracePoint.new {}.enable(target: method(:foo)) # Raise is not supported with a target TracePoint.new(:raise, :return) {}.enable(target: method(:foo)) foo Crashes with: Assertion Failed: vm_insnhelper.c:7026:vm_trace:(iseq_local_events & ~(0x0001 | 0x0002 | 0x0004 | 0x0008 | 0x0010| 0x0020| 0x0040 | 0x0100 | 0x0200 | 0x4000 | 0x010000| 0x020000)) == 0 Notes: Merged: https://github.com/ruby/ruby/pull/11390
2024-08-16[DOC] Tweaks to Array#assoc (#11384)Burdette Lamar
Notes: Merged-By: peterzhu2118 <[email protected]>
2024-08-16[ruby/openssl] Remove test_ed25519_not_approved_on_fips.Jun Aruga
This commit fixes the following failure on OpenSSL master FIPS case. ``` 1) Failure: test_ed25519_not_approved_on_fips(OpenSSL::TestPKey): OpenSSL::PKey::PKeyError expected but nothing was raised. /home/runner/work/openssl/openssl/vendor/bundle/ruby/3.0.0/gems/test-unit-ruby-core-1.0.6/lib/core_assertions.rb:462:in `assert_raise' /home/runner/work/openssl/openssl/test/openssl/test_pkey.rb:174:in `test_ed25519_not_approved_on_fips' 171: MC4CAQAwBQYDK2VwBCIEIEzNCJso/5banbbDRuwRTg9bijGfNaumJNqM9u1PuKb7 172: -----END PRIVATE KEY----- 173: EOF => 174: assert_raise(OpenSSL::PKey::PKeyError) do 175: OpenSSL::PKey.read(priv_pem) 176: end 177: end ``` Because FIPS compliance is a continually moving target. According to the [1], FIPS 140-3 *currently* allows ED25519. The ED25519 is allowed again with the latest OpenSSL FIPS by the commit [2], while it is not allowed in OpenSSL stable version 3.x FIPS. Remove this test because we want to keep our tests stable. [1] https://github.com/openssl/openssl/discussions/22054 [2] https://github.com/openssl/openssl/commit/5f04124aab4a477d4e58149d8f04871ff7e5ea4b https://github.com/ruby/openssl/commit/d43904b834
2024-08-16Speed up finalizers for objects without object IDPeter Zhu
If the object being finalized does not have an object ID, then we don't need to insert into the object ID table, we can simply just allocate a new object ID by bumping the next_object_id counter. This speeds up finalization for objects that don't have an object ID. For example, the following script now runs faster: 1_000_000.times do o = Object.new ObjectSpace.define_finalizer(o) {} end Before: Time (mean ± σ): 1.462 s ± 0.019 s [User: 1.360 s, System: 0.094 s] Range (min … max): 1.441 s … 1.503 s 10 runs After: Time (mean ± σ): 1.199 s ± 0.015 s [User: 1.103 s, System: 0.086 s] Range (min … max): 1.181 s … 1.229 s 10 runs
2024-08-16Revert soname changesRaed Rizqie
- only i386-ucrt soname is changed to fix building on x86 clang - fix detection of x86intrin.h on x86 system - mingw does not have LIBRUBY_SONAME Notes: Merged: https://github.com/ruby/ruby/pull/11362
2024-08-16Stringize VM_ASSERT expression before expansionNobuyoshi Nakada
2024-08-16Parenthesize macro argumentsNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/11389
2024-08-16Simplify and clarify bitmask calculationNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/11389
2024-08-16[ruby/openssl] test_s_generate_parameters: Consider a DSA error in FIPS.Jun Aruga
DSA kengen is not FIPS-approved. The `EVP_PKEY_paramgen` in the `OpenSSL::PKey.generate_parameters("DSA")` raises a DSA error in FIPS by the following commit. Split the test for DSA. https://github.com/openssl/openssl/commit/49a35f0#diff-605396c063194975af8ce31399d42690ab18186b422fb5012101cc9132660fe1R611-R614 https://github.com/ruby/openssl/commit/5ca6eb4eca
2024-08-16Fix some warningsRaed Rizqie
* Fix unused functions when no `mmap`. ``` shape.c:285:1: warning: unused function 'redblack_insert' [-Wunused-function] 285 | redblack_insert(redblack_node_t * tree, ID key, rb_shape_t * value) | ^~~~~~~~~~~~~~~ ``` * Fix unknown warning group '-Wmaybe-uninitialized' with clang. ``` thread_win32.c:596:1: warning: unknown warning group '-Wmaybe-uninitialized', ignored [-Wunknown-warning-option] 596 | COMPILER_WARNING_IGNORED(-Wmaybe-uninitialized) | ^ ``` Co-authored-by: Nobuyoshi Nakada <[email protected]> Notes: Merged: https://github.com/ruby/ruby/pull/11376 Merged-By: nobu <[email protected]>
2024-08-16Fix flaky TestSetTraceFunc#test_remove_in_trace by filtering trace eventsNaoto Ono
Notes: Merged: https://github.com/ruby/ruby/pull/11368
2024-08-15Avoid hash allocation for certain proc callsJeremy Evans
Previous, proc calls such as: ```ruby proc{|| }.(**empty_hash) proc{|b: 1| }.(**r2k_array_with_empty_hash) ``` both allocated hashes unnecessarily, due to two separate code paths. The first call goes through CALLER_SETUP_ARG/vm_caller_setup_keyword_hash, and is simple to fix by not duping an empty keyword hash that will be dropped. The second case is more involved, in setup_parameters_complex, but is fixed the exact same way as when the ruby2_keywords hash is not empty, by flattening the rest array to the VM stack, ignoring the last element (the empty keyword splat). Add a flatten_rest_array static function to handle this case. Update test_allocation.rb to automatically convert the method call allocation tests to proc allocation tests, at least for the calls that can be converted. With the code changes, all proc call allocation tests pass, showing that proc calls and method calls now allocate the same number of objects. I've audited the allocation tests, and I believe that all of the low hanging fruit has been collected. All remaining allocations are either caller side: * Positional splat + post argument * Multiple positional splats * Literal keywords + keyword splat * Multiple keyword splats Or callee side: * Positional splat parameter * Keyword splat parameter * Keyword to positional argument conversion for methods that don't accept keywords * ruby2_keywords method called with keywords Notes: Merged: https://github.com/ruby/ruby/pull/11258
2024-08-15Don't assume st_data_t and VALUE are the same in rb_gc_impl_object_idPeter Zhu
2024-08-15[PRISM] Use src encoding not ext encodingKevin Newton
Notes: Merged: https://github.com/ruby/ruby/pull/11386
2024-08-15[PRISM] test_invalid_jump assertion updates for prismKevin Newton
Notes: Merged: https://github.com/ruby/ruby/pull/11386
2024-08-15[PRISM] test_syntax_check assertion updates for prismKevin Newton
Notes: Merged: https://github.com/ruby/ruby/pull/11386
2024-08-15Show anonymous and ambiguous params in ISeq disassemblyKevin Newton
Previously, in the disasesmbly for ISeqs, there's no way to know if the anon_rest, anon_kwrest, or ambiguous_param0 flags are set. This commit extends the names of the rest, kwrest, and lead params to display this information. They are relevant for the ISeqs' runtime behavior. Notes: Merged: https://github.com/ruby/ruby/pull/11237 Merged-By: XrXr
2024-08-15[DOC] Tweaks for Array#atBurdetteLamar
Notes: Merged: https://github.com/ruby/ruby/pull/11385
2024-08-15[ruby/prism] Fix up lex result constantsKevin Newton
https://github.com/ruby/prism/commit/084baca463
2024-08-15[DOC] Tweaks for Array#pushBurdetteLamar
Notes: Merged: https://github.com/ruby/ruby/pull/11382
2024-08-15[DOC] Fix Related for Array#all?BurdetteLamar
Notes: Merged: https://github.com/ruby/ruby/pull/11381
2024-08-15[DOC] Tweaks for Array#any?BurdetteLamar
Notes: Merged: https://github.com/ruby/ruby/pull/11380
2024-08-15[ruby/prism] Special error for too short unicode errorsKevin Newton
https://github.com/ruby/prism/commit/9f1f7d08bd
2024-08-15Fix GC_ASSERT for gc.c and gc/default.cPeter Zhu
gc.c mistakenly defined GC_ASSERT as blank, which caused it to be a no-op. This caused all assertions in gc.c and gc/default.c to not do anything. This commit fixes it by moving the definition of GC_ASSERT to gc/gc.h. Notes: Merged: https://github.com/ruby/ruby/pull/11377
2024-08-15[ruby/rdoc] Fix sidebar scroll again and add missing footer backStan Lo
(https://github.com/ruby/rdoc/pull/1154) * Add missing footers In #1152 the footer partial was only added to the index.rhtml file. This commit adds the footer partial to the other template files. * Remove unnecessary middle divs in nav * Simplify sidebar's overflow settings Because sidebar needs to be scrollable, its overflow should default to auto. Currently it's set to hidden and force individual elements to set overflow auto, which overcomplicates things. https://github.com/ruby/rdoc/commit/b8c2bcd8db
2024-08-15Delete unnecessary rubocop disable commentKentaro Takeyama
Notes: Merged: https://github.com/ruby/ruby/pull/11357
2024-08-15Improve base time of assert_linear_performance (#11369)tomoya ishida
Remove `.ceil` from base time calculation that makes 10x gap. This will make the assertion more strict and also less flaky. Notes: Merged-By: kou <[email protected]>
2024-08-15Bump github/codeql-action from 3.26.1 to 3.26.2dependabot[bot]
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.26.1 to 3.26.2. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/29d86d22a34ea372b1bbf3b2dced2e25ca6b3384...429e1977040da7a23b6822b13c129cd1ba93dbb2) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Notes: Merged: https://github.com/ruby/ruby/pull/11383
2024-08-14Increase timeout of test_finalizerPeter Zhu
The test is timing out on lpi4a so a longer timeout should fix it.
2024-08-14[PRISM] Trigger moreswitches off shebangKevin Newton
Notes: Merged: https://github.com/ruby/ruby/pull/11378
2024-08-14[ruby/irb] Fix kill pager pid throwing Errno::ESRCH when pagertomoya ishida
process already terminated (https://github.com/ruby/irb/pull/989) https://github.com/ruby/irb/commit/949f032e9b
2024-08-14Fix crash when GC runs during finalizers at shutdownPeter Zhu
We need to remove from the finalizer_table after running all the finalizers because GC could trigger during the finalizer which could reclaim the finalizer table array. The following code crashes: 1_000_000.times do o = Object.new ObjectSpace.define_finalizer(o, proc { }) end Notes: Merged: https://github.com/ruby/ruby/pull/11375
2024-08-14[DOC] Tweaks to Array#all? (#11365)Burdette Lamar
Notes: Merged-By: peterzhu2118 <[email protected]>
2024-08-14[ruby/prism] Callback on shebang switchesKevin Newton
Add the ability to receive a callback when the parser encounters a shebang that contains additional switches after the Ruby engine. This is necessary because some command-line flags may be present there that will alter the parse. https://github.com/ruby/prism/commit/afc5000331
2024-08-14[ruby/prism] Tweak inspect representation of `Prism::Location`Koichi ITO
This PR tweaks inspect representation of `Prism::Location`. ## Before During debugging, the meaning of `@location=https://github.com/ruby/prism/commit/21474836481` was unclear: ```console $ ruby -Ilib -rprism -e 'p Prism.lex("puts :hi").value.map(&:first)[1]' #<Prism::Token:0x000000010cd74e40 @source=#<Prism::ASCIISource:0x000000010cb5f808 @source="puts :hi", @start_line=1, @offsets=[0]>, @type=:SYMBOL_BEGIN, @value=":", @location=https://github.com/ruby/prism/commit/21474836481> ``` ## After This PR clarifies the contents of the location object, aligning with what I think user expects: ```console $ ruby -Ilib -rprism -e 'p Prism.lex("puts :hi").value.map(&:first)[1]' #<Prism::Token:0x000000010e174d50 @source=#<Prism::ASCIISource:0x000000010df5efe8 @source="puts :hi", @start_line=1, @offsets=[0]>, @type=:SYMBOL_BEGIN, @value=":", @location=#<Prism::Location @start_offset=5 @length=1 start_line=1>> ``` Although it is uncertain whether Prism will accept this change in the inspect representation, it is submitted here as a suggestion. https://github.com/ruby/prism/commit/e7421ce1c5
2024-08-14[DOC] Update comment about how object ID is calculatedPeter Zhu
The object ID no longer treats symbols in a special way so we can simplify the comment about how it is calculated. Notes: Merged: https://github.com/ruby/ruby/pull/11346
2024-08-14Update bundled gems list as of 2024-08-14git
2024-08-14[ruby/irb] Improve easter_egg logo resolutiontomoya ishida
(https://github.com/ruby/irb/pull/987) https://github.com/ruby/irb/commit/ab394db93f
2024-08-14Increase the default timeout in assert_darwin_vm_dump_worksNaoto Ono
Notes: Merged: https://github.com/ruby/ruby/pull/11373
2024-08-14Bump github/codeql-action from 3.26.0 to 3.26.1dependabot[bot]
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.26.0 to 3.26.1. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/eb055d739abdc2e8de2e5f4ba1a8b246daa779aa...29d86d22a34ea372b1bbf3b2dced2e25ca6b3384) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Notes: Merged: https://github.com/ruby/ruby/pull/11374
2024-08-13[ruby/resolv] test_dns: Fix failure on WindowsSorah Fukumori
(https://github.com/ruby/resolv/pull/58) test_dns: Fix failure on Windows 1. Switch to #with_udp_and_tcp helper method for EACCES retries on Windows; the given UDP socket is unnecessary though. 2. Using 127.0.0.1 should be fine, as it must give different host:port pair. 3. On Windows, 5 retries of bind(2) appears still flaky, doubling it for sure. follow-up: https://github.com/ruby/resolv/pull/50 follow-up: https://github.com/ruby/resolv/commit/6252914e95dfdf8995d8074df6cafe6f0a76c1ca https://github.com/ruby/resolv/commit/0a0d57e369
2024-08-13[ruby/resolv] Reuse open TCP connectionKasumi Hanazuki
[RFC7766] Section 5 recommends stub resolvers to reuse open TCP connections to a nameserver. [RFC7766]: https://datatracker.ietf.org/doc/html/rfc7766 https://github.com/ruby/resolv/commit/9bf1b08f5c
2024-08-13[ruby/resolv] Fix TCP fallback with multiple nameserversIgor Pstyga
Under the following conditions the exception `Resolv::DNS::Requester::RequestError: host/port don't match` is raised: - Multiple nameservers are configured for Resolv::DNS - A nameserver falls back from UDP to TCP - TCP request hits Resolv::DNS timeout - Resolv::DNS retries the next nameserver More details here https://bugs.ruby-lang.org/issues/8285 https://github.com/ruby/resolv/commit/7d524df80e Co-authored-by: Julian Mehnle <[email protected]>
2024-08-13Delete newarraykwsplatAlan Wu
The pushtoarraykwsplat instruction was designed to replace newarraykwsplat, and we now meet the condition for deletion mentioned in 77c1233f79a0f96a081b70da533fbbde4f3037fa. Notes: Merged: https://github.com/ruby/ruby/pull/11371 Merged-By: XrXr
2024-08-13Don't set stack end in rb_gc_mark_rootsPeter Zhu
We don't need to set the stack end in rb_gc_mark_roots because it is already set in mark_current_machine_context. Notes: Merged: https://github.com/ruby/ruby/pull/11355
2024-08-13Re-initialize vm->ractor.sched.lock after forkJohn Hawthorn
Previously under certain conditions it was possible to encounter a deadlock in the forked child process if ractor.sched.lock was held. Co-authored-by: Nathan Froyd <[email protected]> Notes: Merged: https://github.com/ruby/ruby/pull/11356
2024-08-13Sync rdocStan Lo