summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-08-13[ruby/prism] Fix up spacing in generated node.rbKevin Newton
https://github.com/ruby/prism/commit/50d79b734b
2024-08-13Make sure to wait for the thread to exit in TestProcess#test_wait_and_sigchildNaoto Ono
Notes: Merged: https://github.com/ruby/ruby/pull/11366
2024-08-13do not show unused block on `send`Koichi Sasada
Some case it is difficult to know the calling method uses a block or not with `send` on a general framework. So this patch stops showing unused block warning on `send`. example with test/unit: ```ruby require 'test/unit' class T < Test::Unit::TestCase def setup end def test_foo = nil end ``` => /home/ko1/ruby/install/master/lib/ruby/gems/3.4.0+0/gems/test-unit-3.6.2/lib/test/unit/fixture.rb:284: warning: the block passed to 'priority_setup' defined at /home/ko1/ruby/install/master/lib/ruby/gems/3.4.0+0/gems/test-unit-3.6.2/lib/test/unit/priority.rb:183 may be ignored because test/unit can call any setup method (`priority_setup` in this case) with a block. Maybe we can show the warning again when we provide a way to recognize the calling method uses a block or not. Notes: Merged: https://github.com/ruby/ruby/pull/11349
2024-08-12Revert change of "mingw-ucrt" platform stringLars Kanis
... of commit 00176cd40fe9f385231e9c20b956fc4a84d240b9. The reverted change was made only for constistency, as discussed in https://github.com/ruby/ruby/pull/11358#issuecomment-2282222369 But the platform string "mingw-ucrt" should not be changed. It is used as RUBY_PLATFORM and as the rubygems platform, so that there should be a good reason to change the name of an established platform. "mingw-ucrt" was introduced intentionally in commit 576b2e64cdc5ea42ad345dd3c1c215e006c06fca. Related to GH-11358 Notes: Merged: https://github.com/ruby/ruby/pull/11364 Merged-By: XrXr
2024-08-13Launchable: Fix condition for bootstraptestNaoto Ono
Notes: Merged: https://github.com/ruby/ruby/pull/11340
2024-08-12[ruby/prism] Add sample for generating tagsKevin Newton
https://github.com/ruby/prism/commit/7c9ca47ac5
2024-08-12Fix memory leak reported in -test-/random/loop.cPeter Zhu
RUBY_TYPED_DEFAULT_FREE will only free the rand_loop_t, but it will cause the buf to be leaked. This commit fixes the memory leak by implementing a free function for the rand_loop_t type. Notes: Merged: https://github.com/ruby/ruby/pull/11354
2024-08-12Fix next inside block argument stack underflowtompng
[Bug #20344] Fix compile_next adding removable adjust label Notes: Merged: https://github.com/ruby/ruby/pull/11316
2024-08-12Update bundled gems list as of 2024-08-12git
2024-08-11compile.c: don't allocate empty default values listJean Boussier
It just wastes memory. Notes: Merged: https://github.com/ruby/ruby/pull/11361
2024-08-11Fix sign-conversion warningNobuyoshi Nakada
``` ../../.././include/ruby/internal/special_consts.h:349:36: error: conversion to ‘VALUE’ {aka ‘long unsigned int’} from ‘int’ may change the sign of the result [-Werror=sign-conversion] 349 | return RB_SPECIAL_CONST_P(obj) * RUBY_Qtrue; | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~ ```
2024-08-11Show mkmf.log when failedNobuyoshi Nakada
2024-08-11Fix flag test macroNobuyoshi Nakada
`RBOOL` is a macro to convert C boolean to Ruby boolean. Notes: Merged: https://github.com/ruby/ruby/pull/11351
2024-08-11Evaluate macro arguments just onceNobuyoshi Nakada
And fix unclosed parenthesis. Notes: Merged: https://github.com/ruby/ruby/pull/11351
2024-08-11Increase timeout of test-bundler-parallelNobuyoshi Nakada
Even if it succeeds, it takes almost 40 minutes.
2024-08-11fix ucrt archRaed Rizqie
Notes: Merged: https://github.com/ruby/ruby/pull/11358
2024-08-11fix i386-ucrt buildRaed Rizqie
Notes: Merged: https://github.com/ruby/ruby/pull/11358
2024-08-10Cherry-pick test for [Bug #20668]Jean Boussier
The bug didn't impact master because this was largely refactored, but it's still valuable to add the test for it to prevent future regressions. Notes: Merged: https://github.com/ruby/ruby/pull/11359
2024-08-10[ruby/prism] [Doc] Tweak the docs for lex APIsKoichi ITO
`Prism.lex` and `Prism.lex_file` return `ParseLexResult` instead of `Array`. `Prism::parse_lex` and `Prism::parse_lex_file` return `ParseLexResult` instead of `ParseResult`. This PR updates the documentation to reflect these return values. https://github.com/ruby/prism/commit/ee331941c0
2024-08-10rb_setup_fake_ary: use precomputed flagsJean Boussier
Setting up the fake array is a bit more expensive than would be expected because `rb_ary_freeze` does a lot of checks and lookup a shape transition. If we assume fake arrays will always be frozen, we can precompute the flags state and just assign it. Notes: Merged: https://github.com/ruby/ruby/pull/11344
2024-08-09[ruby/psych] Guard from memory leak in Psych::Emitter#start_documentPeter Zhu
When an exception is raised, it can leak memory in `head`. There are two places that can leak memory: 1. `Check_Type(tuple, T_ARRAY)` can leak memory if `tuple` is not an array. 2. `StringValue(name)` and `StringValue(value)` if they are not strings and the call to `to_str` does not return a string. This commit fixes these memory leaks by wrapping the code around a rb_ensure so that the memory is freed in all cases. The following code demonstrates the memory leak: emitter = Psych::Emitter.new(StringIO.new) nil_to_string_tags = [[nil, "tag:TALOS"]] + ([1] * 1000) expected_array_tags = [1] * 1000 10.times do 1_000.times do # Raises `no implicit conversion of nil into String` emitter.start_document([], nil_to_string_tags, 0) rescue TypeError end 1_000.times do # Raises `wrong argument type Integer (expected Array)` emitter.start_document([], expected_array_tags, 0) rescue TypeError end puts `ps -o rss= -p #{$$}` end Before: 47248 79728 111968 144224 176480 208896 241104 273280 305472 337664 After: 14832 15088 15344 15344 15360 15632 15632 15632 15648 15648 https://github.com/ruby/psych/commit/053af73818
2024-08-09rb_str_bytesplice: skip encoding check if encodings are the sameJean Boussier
If both strings have the same encoding, all this work is useless. Notes: Merged: https://github.com/ruby/ruby/pull/11353
2024-08-09string.c: add fastpath in str_ensure_byte_posJean Boussier
If the string only contain single byte characters we can skips all the costly checks. Notes: Merged: https://github.com/ruby/ruby/pull/11353
2024-08-09string.c: Add fastpath to single_byte_optimizableJean Boussier
`rb_enc_from_index` is a costly operation so it is worth avoiding to call it for the common encodings. Also in the case of UTF-8, it's more efficient to scan the coderange if it is unknown that to fallback to the slower algorithms. Notes: Merged: https://github.com/ruby/ruby/pull/11353
2024-08-09[DOC] Regexp.last_match returns `$~`, not `$!`Alan Wu
2024-08-09Add psych expand tabs commit to .git-blame-ignore-revs [ci skip]Peter Zhu
2024-08-09[ruby/psych] Convert tabs to spaces in test/psych/test_yaml.rbPeter Zhu
https://github.com/ruby/psych/commit/64bfc308f8
2024-08-09[ruby/psych] Convert missed tabs to spaces in C filesPeter Zhu
https://github.com/ruby/psych/commit/74a6b4d226
2024-08-09Add expand tabs commit in psych to .git-blame-ignore-revsPeter Zhu
2024-08-09[ruby/psych] Convert tabs to spaces in C filesPeter Zhu
https://github.com/ruby/psych/commit/e7d64c9848
2024-08-09Remove rb_gc_impl_objspace_markPeter Zhu
It's not necessary for the GC implementation to call rb_gc_mark_roots which calls back into the GC implementation's rb_gc_impl_objspace_mark. Notes: Merged: https://github.com/ruby/ruby/pull/11325
2024-08-09string.c: str_capacity don't check for immediatesJean Boussier
`STR_EMBED_P` uses `FL_TEST_RAW` meaning we already assume `str` isn't an immediate, so we can use `FL_TEST_RAW` here too. Notes: Merged: https://github.com/ruby/ruby/pull/11350
2024-08-09str_independent: add a fastpath with a single flag checkJean Boussier
If we assume that most strings we modify are not frozen and are independent, then we can optimize this case by replacing multiple flag checks by a single mask check. Notes: Merged: https://github.com/ruby/ruby/pull/11350
2024-08-09Increase timeout in `test_darwin_invalid_call` methodNaoto Ono
Notes: Merged: https://github.com/ruby/ruby/pull/11348
2024-08-08YJIT: Allow tracing fallback counters (#11347)Takashi Kokubun
* YJIT: Allow tracing fallback counters * Update yjit.md about --yjit-trace-exits=counter Notes: Merged-By: k0kubun <[email protected]>
2024-08-08[DOC] Tweaks for Array#[]= (#11329)Burdette Lamar
Notes: Merged-By: peterzhu2118 <[email protected]>
2024-08-08[DOC] Add remark about in-brief for method docBurdetteLamar
Notes: Merged: https://github.com/ruby/ruby/pull/11330
2024-08-08[DOC] Tweaks for Array#[]BurdetteLamar
Notes: Merged: https://github.com/ruby/ruby/pull/11328
2024-08-08[DOC] Tweaks for Array#[]BurdetteLamar
Notes: Merged: https://github.com/ruby/ruby/pull/11328
2024-08-08[DOC] Tweaks for Array#==BurdetteLamar
Notes: Merged: https://github.com/ruby/ruby/pull/11327
2024-08-08Sync rdoc to fix master doc's display issue (#11345)Stan Lo
Sync rdoc This syncs changes made in https://github.com/ruby/rdoc/pull/1148, which will fix https://docs.ruby-lang.org/en/master/'s display on certain screens. Notes: Merged-By: k0kubun <[email protected]>
2024-08-08Make YJIT a GC root rather than an object (#11343)Peter Zhu
YJIT currently uses the YJIT root object to mark objects during GC and update references during compaction. This object otherwise serves no purpose. This commit changes it YJIT to be step when marking the GC root. This saves some memory from being allocated from the system and the GC. Notes: Merged-By: maximecb <[email protected]>
2024-08-08Disable GC even during finalizingPeter Zhu
We're seeing a crash during shutdown in rb_gc_impl_objspace_free because it's running lazy sweeping during shutdown. It appears that it's due to `finalizing` being set, which causes GC to not be aborted and not disabled which causes it to be in lazy sweeping at shutdown. The full stack trace is: #6 rb_bug (fmt=fmt@entry=0x5643b8ebde78 "lazy sweeping underway when freeing object space") at error.c:1095 #7 0x00005643b8a3c697 in rb_gc_impl_objspace_free (objspace_ptr=<optimized out>) at gc/default.c:9507 #8 0x00005643b8c269eb in ruby_vm_destruct (vm=0x7e2fdc84d000) at vm.c:3141 #9 0x00005643b8a5147b in rb_ec_cleanup (ec=<optimized out>, ex=<optimized out>) at eval.c:263 #10 0x00005643b8a51c93 in ruby_run_node (n=<optimized out>) at eval.c:319 #11 0x00005643b8a4c7c7 in rb_main (argv=0x7fffef15e7f8, argc=18) at ./main.c:43 #12 main (argc=<optimized out>, argv=<optimized out>) at ./main.c:62 Notes: Merged: https://github.com/ruby/ruby/pull/11317
2024-08-08Added test scenario for https://github.com/ruby/ruby/pull/11322Hiroshi SHIBATA
2024-08-08We should use uplevel:2 in another case.Hiroshi SHIBATA
Like the following scenario with bootsnap, that frames are same or smaller than frame_to_skip(=3). --- "/Users/hsbt/.local/share/rbenv/versions/3.3-dev/lib/ruby/3.3.0/bundled_gems.rb:69:in `block (2 levels) in replace_require'" "/Users/hsbt/.local/share/gem/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'" "test_warn_bootsnap.rb:11:in `<main>'" ---
2024-08-08lib/bundled_gems.rb: more reliable caller detectionJean Boussier
The `2` skipped frames went out of sync and now it should be `3`. Rather than just update the offset, we can implement a way that is adaptative as long as all require decorators are also called require. Also we should compute the corresponding `uplevel` otherwise the warning will still point decorators. Co-authored-by: "Hiroshi SHIBATA" <[email protected]>
2024-08-08Partly reverted 09638741ba4d9547a0e48af8c767744fb1d7f68dHiroshi SHIBATA
This change didn't work with Ruby 3.3. We should revert this to test bundled_gems.rb with Ruby 3.3.
2024-08-08Revert "[ruby/uri] Warn compatibility methods in RFC3986_PARSER"Hiroshi SHIBATA
This reverts commit c3becc3ba6c584fbeabd5182e304e61529235fe6. Notes: Merged: https://github.com/ruby/ruby/pull/11333
2024-08-08[ruby/uri] Use URI::RFC2396_PARSER explicitly in URIHiroshi SHIBATA
https://github.com/ruby/uri/commit/898b889811
2024-08-08[ruby/uri] Warn compatibility methods in RFC3986_PARSERHiroshi SHIBATA
https://github.com/ruby/uri/commit/9997c1acee