summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-09-10[rubygems/rubygems] Remove unnecessary verificationDavid Rodríguez
`DSL#to_definition` already verifies this. https://github.com/rubygems/rubygems/commit/c596f0af83
2024-09-10[rubygems/rubygems] Avoid having to redefine `Definition#lock` in inline modeDavid Rodríguez
https://github.com/rubygems/rubygems/commit/0b7be7bb77 Co-authored-by: Jonathan Hefner <[email protected]>
2024-09-09[DOC] Fix missing colons in StringPeter Zhu
2024-09-09[DOC] Rationalize aliases in "What's Here" (#11517)Burdette Lamar
Notes: Merged-By: peterzhu2118 <[email protected]>
2024-09-09[DOC] Rationalize aliases in "What's Here" (#11516)Burdette Lamar
Notes: Merged-By: peterzhu2118 <[email protected]>
2024-09-09[ruby/prism] Fix a token incompatibility for `Prism::Translation::Parser::Lexer`Koichi ITO
This PR fixes a token incompatibility between Parser gem and `Prism::Translation::Parser` for double splat argument. ## Parser gem (Expected) Returns `tDSTAR` token: ```console $ bundle exec ruby -Ilib -rparser/ruby33 -ve \ 'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "def f(**foo) end"; p Parser::Ruby33.new.tokenize(buf)[2]' ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23] [[:kDEF, ["def", #<Parser::Source::Range example.rb 0...3>]], [:tIDENTIFIER, ["f", #<Parser::Source::Range example.rb 4...5>]], [:tLPAREN2, ["(", #<Parser::Source::Range example.rb 5...6>]], [:tDSTAR, ["**", #<Parser::Source::Range example.rb 6...8>]], [:tIDENTIFIER, ["foo", #<Parser::Source::Range example.rb 8...11>]], [:tRPAREN, [")", #<Parser::Source::Range example.rb 11...12>]], [:kEND, ["end", #<Parser::Source::Range example.rb 13...16>]]] ``` ## `Prism::Translation::Parser` (Actual) Previously, the parser returned `tPOW` token when parsing the following: ```console $ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve \ 'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "def f(**foo) end"; p Prism::Translation::Parser33.new.tokenize(buf)[2]' ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23] [[:kDEF, ["def", #<Parser::Source::Range example.rb 0...3>]], [:tIDENTIFIER, ["f", #<Parser::Source::Range example.rb 4...5>]], [:tLPAREN2, ["(", #<Parser::Source::Range example.rb 5...6>]], [:tPOW, ["**", #<Parser::Source::Range example.rb 6...8>]], [:tIDENTIFIER, ["foo", #<Parser::Source::Range example.rb 8...11>]], [:tRPAREN, [")", #<Parser::Source::Range example.rb 11...12>]], [:kEND, ["end", #<Parser::Source::Range example.rb 13...16>]]] ``` After the update, the parser now returns `tDSTAR` token for the same input: ```console $ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve \ 'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "def f(**foo) end"; p Prism::Translation::Parser33.new.tokenize(buf)[2]' ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23] [[:kDEF, ["def", #<Parser::Source::Range example.rb 0...3>]], [:tIDENTIFIER, ["f", #<Parser::Source::Range example.rb 4...5>]], [:tLPAREN2, ["(", #<Parser::Source::Range example.rb 5...6>]], [:tDSTAR, ["**", #<Parser::Source::Range example.rb 6...8>]], [:tIDENTIFIER, ["foo", #<Parser::Source::Range example.rb 8...11>]], [:tRPAREN, [")", #<Parser::Source::Range example.rb 11...12>]], [:kEND, ["end", #<Parser::Source::Range example.rb 13...16>]]] ``` With this change, the following code could be removed from test/prism/ruby/parser_test.rb: ```diff - when :tPOW - actual_token[0] = expected_token[0] if expected_token[0] == :tDSTAR ``` `tPOW` is the token type for the behavior of `a ** b`, and its behavior remains unchanged: ```console $ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve \ 'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "a ** b"; p Prism::Translation::Parser33.new.tokenize(buf)[2]' ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23] [[:tIDENTIFIER, ["a", #<Parser::Source::Range example.rb 0...1>]], [:tPOW, ["**", #<Parser::Source::Range example.rb 2...4>]], [:tIDENTIFIER, ["b", #<Parser::Source::Range example.rb 5...6>]]] ``` https://github.com/ruby/prism/commit/66bde35a44
2024-09-09ASAN unlock freelist in size_pool_add_pagePeter Zhu
2024-09-09ASAN unlock freelist in gc_sweep_stepPeter Zhu
2024-09-09Add keys to GC.stat and fix testsPeter Zhu
This adds keys heap_empty_pages and heap_allocatable_slots to GC.stat.
2024-09-09Implement global allocatable slots and empty pagesPeter Zhu
[Bug #20710] This commit introduces moves allocatable slots and empty pages from per size pool to global. This allows size pools to grow globally and allows empty pages to move between size pools. For the benchmark in [Bug #20710], this signficantly improves performance: Before: new_env 2.563 (± 0.0%) i/s - 26.000 in 10.226703s new_rails_env 0.293 (± 0.0%) i/s - 3.000 in 10.318960s After: new_env 3.781 (±26.4%) i/s - 37.000 in 10.302374s new_rails_env 0.911 (± 0.0%) i/s - 9.000 in 10.049337s In the headline benchmarks on yjit-bench, we see the performance is basically on-par with before, with ruby-lsp being signficantly faster and activerecord and erubi-rails being slightly slower: -------------- ----------- ---------- ----------- ---------- -------------- ------------- bench master (ms) stddev (%) branch (ms) stddev (%) branch 1st itr master/branch activerecord 452.2 0.3 479.4 0.4 0.96 0.94 chunky-png 1157.0 0.4 1172.8 0.1 0.99 0.99 erubi-rails 905.4 0.3 967.2 0.4 0.94 0.94 hexapdf 3566.6 0.6 3553.2 0.3 1.03 1.00 liquid-c 88.9 0.9 89.0 1.3 0.98 1.00 liquid-compile 93.4 0.9 89.9 3.5 1.01 1.04 liquid-render 224.1 0.7 227.1 0.5 1.00 0.99 lobsters 1052.0 3.5 1067.4 2.1 0.99 0.99 mail 197.1 0.4 196.5 0.5 0.98 1.00 psych-load 2960.3 0.1 2988.4 0.8 1.00 0.99 railsbench 2252.6 0.4 2255.9 0.5 0.99 1.00 rubocop 262.7 1.4 270.1 1.8 1.02 0.97 ruby-lsp 275.4 0.5 242.0 0.3 0.97 1.14 sequel 98.4 0.7 98.3 0.6 1.01 1.00 -------------- ----------- ---------- ----------- ---------- -------------- -------------
2024-09-09Replace heap_allocated_pages with rb_darray_sizePeter Zhu
2024-09-09Switch sorted list of pages in the GC to a darrayPeter Zhu
2024-09-09Implement String#append_as_bytes(String | Integer, ...)Jean Boussier
[Feature #20594] A handy method to construct a string out of multiple chunks. Contrary to `String#concat`, it doesn't do any encoding negociation, and simply append the content as bytes regardless of whether this result in a broken string or not. It's the caller responsibility to check for `String#valid_encoding?` in cases where it's needed. When passed integers, only the lower byte is considered, like in `String#setbyte`. Notes: Merged: https://github.com/ruby/ruby/pull/11552
2024-09-09[rubygems/rubygems] Don't include hook templates in cached git sourceDaniel Colson
With a default git setup, each cloned repo in the cache will end up with ~60K of sample git hooks. These files all end in `.sample`, and they are disabled by default. Deleting them should be a no-op, and makes the cache a bit smaller. https://github.com/rubygems/rubygems/commit/d2149999cd
2024-09-09Update clang for LTONobuyoshi Nakada
2024-09-09Run just bignum related tests when gmp enabledNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/11574
2024-09-09Return back legacy Range#step behavior for symbol rangeszverok
Notes: Merged: https://github.com/ruby/ruby/pull/11573
2024-09-09[rubygems/rubygems] Avoid now unnecessary resetDavid Rodríguez
https://github.com/rubygems/rubygems/commit/511c7b211b
2024-09-09[rubygems/rubygems] Make `gem exec` use the standard GEM_HOMEDavid Rodríguez
https://github.com/rubygems/rubygems/commit/032b3c518a
2024-09-09[rubygems/rubygems] Fix `gem fetch` always exiting with zero status codeDavid Rodríguez
https://github.com/rubygems/rubygems/commit/5887e6dfa1
2024-09-09Suppress discards qualifiers warning with ASNNobuyoshi Nakada
2024-09-09Update default gems list at 2d4fdafa64cc3153792c870a56971a [ci skip]git
2024-09-09[ruby/psych] Bump up 5.2.0.beta1Hiroshi SHIBATA
https://github.com/ruby/psych/commit/a8b73bb80e
2024-09-09[ruby/psych] Unlimited line_width with -1Juanjo Bazán
https://github.com/ruby/psych/commit/3b63a93dfc
2024-09-09[ruby/psych] Make to load stringio lazilyHiroshi SHIBATA
https://github.com/ruby/psych/commit/9f5392d180
2024-09-09[ruby/psych] docs: specify correct default `fallback` valueGareth Jones
https://github.com/ruby/psych/commit/ce7946981d
2024-09-09Implement WHEN NODE locationsydah
Notes: Merged: https://github.com/ruby/ruby/pull/11553
2024-09-09The Timeout::Error example no longer works consistentlyJP Camara
* This PR from the timeout gem (https://github.com/ruby/timeout/pull/30) made it so you have to handle_interrupt on Timeout::ExitException instead of Timeout::Error * Efficiency changes to the gem (one shared thread) mean you can't consistently handle timeout errors using handle_timeout: https://github.com/ruby/timeout/issues/41 Notes: Merged: https://github.com/ruby/ruby/pull/11474
2024-09-08[ruby/benchmark] Set required_ruby_version = ">= 2.1.0"Earlopain
`Process.clock_gettime` only works since 2.1 https://github.com/ruby/benchmark/commit/94cfe56291
2024-09-09Clean up dummped IBF filesNobuyoshi Nakada
2024-09-08Initialize goruby only when executingNobuyoshi Nakada
2024-09-08Fix prelude to use IBFNobuyoshi Nakada
Since universal-parser and prism support, prelude code used functions inaccessible from outside libruby shared library. ``` linking goruby /usr/bin/ld: goruby.o: in function `prelude_eval': /home/runner/work/ruby/ruby/build/golf_prelude.c:221: undefined reference to `rb_ruby_prism_ptr' /usr/bin/ld: goruby.o: in function `pm_prelude_load': /home/runner/work/ruby/ruby/build/golf_prelude.c:192: undefined reference to `pm_options_line_set' /usr/bin/ld: /home/runner/work/ruby/ruby/build/golf_prelude.c:193: undefined reference to `pm_parse_string' /usr/bin/ld: goruby.o: in function `prelude_eval': /home/runner/work/ruby/ruby/build/golf_prelude.c:224: undefined reference to `pm_iseq_new_with_opt' /usr/bin/ld: /home/runner/work/ruby/ruby/build/golf_prelude.c:226: undefined reference to `pm_parse_result_free' /usr/bin/ld: goruby.o: in function `prelude_ast_value': /home/runner/work/ruby/ruby/build/golf_prelude.c:181: undefined reference to `rb_ruby_ast_data_get' /usr/bin/ld: goruby.o: in function `prelude_eval': /home/runner/work/ruby/ruby/build/golf_prelude.c:231: undefined reference to `rb_ruby_ast_data_get' /usr/bin/ld: goruby.o: in function `pm_prelude_load': /home/runner/work/ruby/ruby/build/golf_prelude.c:196: undefined reference to `pm_parse_result_free' collect2: error: ld returned 1 exit status ```
2024-09-08Extract `rb_builtin_find`Nobuyoshi Nakada
Refactor out the same code from `rb_builtin_ast_value` and `pm_builtin_ast_value.
2024-09-08Gather code for builtin loading to miniinit.cNobuyoshi Nakada
2024-09-08Try to run gorubyNobuyoshi Nakada
2024-09-08[ruby/open-uri] Update error message for `request_specific_fields` option ↵otegami
validation Added `inspect` to the `request_specific_fields` value to provide better visibility for users in the exception message. https://github.com/ruby/open-uri/commit/f89ce5112d
2024-09-08[ruby/open-uri] Add documentation for `request_specific_fields` optionotegami
https://github.com/ruby/open-uri/commit/2e7734c061
2024-09-08[ruby/open-uri] Add test about `request_specific_fields` optionotegami
https://github.com/ruby/open-uri/commit/060886f312
2024-09-08[ruby/open-uri] Add `request_specific_fields` option for customizing headersotegami
This commit introduces the `request_specific_fields` option in OpenURI. It provides two methods for customizing headers as follows. 1. Specify headers only for the initial request Use a Hash to apply headers only to the first request. These headers are automatically removed during redirects. 2. Specify headers dynamically for each request Use a Proc to dynamically generate headers for each request, including during redirects, based on the request URL. This feature allows users to control headers flexibly, ensuring that sensitive headers like "Authorization" are not unintentionally transferred during redirects unless explicitly specified. https://github.com/ruby/open-uri/commit/460f858e3c
2024-09-08[ruby/rdoc] Use pointer cursor for navigation toggleMads Ohm Larsen
(https://github.com/ruby/rdoc/pull/1175) https://github.com/ruby/rdoc/commit/964a1982c8
2024-09-07[ruby/prism] Fix a token incompatibility for `Prism::Translation::Parser::Lexer`Koichi ITO
This PR fixes a token incompatibility between Parser gem and `Prism::Translation::Parser` for left parenthesis. ## Parser gem (Expected) Returns `tLPAREN2` token: ```console $ bundle exec ruby -Ilib -rparser/ruby33 \ -ve 'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "foo(:bar)"; p Parser::Ruby33.new.tokenize(buf)[2]' ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23] [[:tIDENTIFIER, ["foo", #<Parser::Source::Range example.rb 0...3>]], [:tLPAREN2, ["(", #<Parser::Source::Range example.rb 3...4>]], [:tSYMBOL, ["bar", #<Parser::Source::Range example.rb 4...8>]], [:tRPAREN, [")", #<Parser::Source::Range example.rb 8...9>]]] ``` ## `Prism::Translation::Parser` (Actual) Previously, the parser returned `tLPAREN` token when parsing the following: ```console $ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve \ 'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "foo(:bar)"; p Prism::Translation::Parser33.new.tokenize(buf)[2]' ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23] [[:tIDENTIFIER, ["foo", #<Parser::Source::Range example.rb 0...3>]], [:tLPAREN, ["(", #<Parser::Source::Range example.rb 3...4>]], [:tSYMBOL, ["bar", #<Parser::Source::Range example.rb 4...8>]], [:tRPAREN, [")", #<Parser::Source::Range example.rb 8...9>]]] ``` After the update, the parser now returns `tLPAREN2` token for the same input: ```console $ bundle exec ruby -Ilib -rprism -rprism/translation/parser33 -ve \ 'buf = Parser::Source::Buffer.new("example.rb"); buf.source = "foo(:bar)"; p Prism::Translation::Parser33.new.tokenize(buf)[2]' ruby 3.4.0dev (2024-09-01T11:00:13Z master https://github.com/ruby/prism/commit/eb144ef91e) [x86_64-darwin23] [[:tIDENTIFIER, ["foo", #<Parser::Source::Range example.rb 0...3>]], [:tLPAREN2, ["(", #<Parser::Source::Range example.rb 3...4>]], [:tSYMBOL, ["bar", #<Parser::Source::Range example.rb 4...8>]], [:tRPAREN, [")", #<Parser::Source::Range example.rb 8...9>]]] ``` The `PARENTHESIS_LEFT` token in Prism is classified as either `tLPAREN` or `tLPAREN2` in the Parser gem. The tokens that were previously all classified as `tLPAREN` are now also classified to `tLPAREN2`. With this change, the following code could be removed from `test/prism/ruby/parser_test.rb`: ```diff - when :tLPAREN - actual_token[0] = expected_token[0] if expected_token[0] == :tLPAREN2 ``` https://github.com/ruby/prism/commit/04d6f3478d
2024-09-07Preserve encoding in exception message of `Float`Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/11564
2024-09-07[Bug #20719] `Float` argument must be ASCII compatibleNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/11564
2024-09-07[Bug #20718] Free non-`RTypedData` objectsJonathan Calvert
Allow objects that are not of type `RTypedData` to use the default free function, as `RTYPEDDATA_EMBEDDED_P` can return a false positive when casting non-`RTypedData` objects. Notes: Merged: https://github.com/ruby/ruby/pull/11563 Merged-By: nobu <[email protected]>
2024-09-06[ruby/rdoc] Add more space after magnifying glassMads Ohm Larsen
(https://github.com/ruby/rdoc/pull/1173) https://github.com/ruby/rdoc/commit/6a9cad4c54
2024-09-06Add an explicit check for broken libunwind buildsKJ Tsanaktsidis
Libunwind as packaged in MacOS cannot actually unwind code which has pointer authentication on, because _LIBUNWIND_IS_NATIVE_ONLY is not defined. Add a check for this, and prefer building with working unwinding over pointer authentication if we must make a choice. Notes: Merged: https://github.com/ruby/ruby/pull/11548
2024-09-06Revert "Check for both aarch64 and arm64 arch's for pac-ret"Peter Zhu
This reverts commit 6a746e1bc902d4245aac58db4e9ffc2f72d79629. This patch breaks the C level backtrace on macOS ARM machines. Notes: Merged: https://github.com/ruby/ruby/pull/11548
2024-09-06[rubygems/rubygems] Remove unnecessary "./" when appending string to uriDavid Rodríguez
https://github.com/rubygems/rubygems/commit/732679306d
2024-09-06[rubygems/rubygems] Fix `gem install does-not-exist` being super slowDavid Rodríguez
Every time a gem is not found in the Compact Index API, RubyGems will fallback to the full index, which is very slow. This is unnecessary because both indexes should be providing the same gems, so if a gem can't be found in the Compact Index API, it won't be found in the full index. We _do_ want a fallback to the full index, whenever the Compact Index API is not implemented. To detect that, we check that the API responds to the "/versions" endpoint, just like Bundler does. Before: ``` $ time gem install fooasdsfafs ERROR: Could not find a valid gem 'fooasdsfafs' (>= 0) in any repository gem 20,77s user 0,59s system 96% cpu 22,017 total ``` After: ``` $ time gem install fooasdsfafs ERROR: Could not find a valid gem 'fooasdsfafs' (>= 0) in any repository gem 5,02s user 0,09s system 91% cpu 5,568 total ``` https://github.com/rubygems/rubygems/commit/c0d6b9eea7
2024-09-06[rubygems/rubygems] Deprecate constant that has been unused for a long timeDavid Rodríguez
https://github.com/rubygems/rubygems/commit/282dbb3d62