ml.ruby-lang.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

ruby-core

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
ruby-core@ml.ruby-lang.org

  • 2 participants
  • 4167 discussions
[ruby-core:121798] [Ruby Feature#21300] Suggestion: Method for Array truncation
by sigsys (Math Ieu) 02 May '25

02 May '25
Issue #21300 has been reported by sigsys (Math Ieu). ---------------------------------------- Feature #21300: Suggestion: Method for Array truncation https://bugs.ruby-lang.org/issues/21300 * Author: sigsys (Math Ieu) * Status: Open ---------------------------------------- `#pop(n)` and `#slice!(...)` can be used for truncation, but they both allocate a new array for the deleted elements (unless you do it one at a time with `#pop()`...), which is not always needed. I propose adding a `#size=` method for truncating without allocating a new array: ``` a = [10, 20, 30] a.size = 2 a # [10, 20] ``` Growing the array could be allowed as well... ``` a = [10, 20] a.size = 4 a # [10, 20, nil, nil] ``` -- https://bugs.ruby-lang.org/
2 1
0 0
[ruby-core:121792] [Ruby Misc#21299] Proposal: Remove Continuation Feature from Ruby Core
by ianks (Ian Ker-Seymer) 01 May '25

01 May '25
Issue #21299 has been reported by ianks (Ian Ker-Seymer). ---------------------------------------- Misc #21299: Proposal: Remove Continuation Feature from Ruby Core https://bugs.ruby-lang.org/issues/21299 * Author: ianks (Ian Ker-Seymer) * Status: Open * Assignee: ioquatix (Samuel Williams) ---------------------------------------- Continuations have been obsolete since Ruby 2.2 but still add complexity to the core codebase. I propose removing all continuation support from Ruby Core. ### Reasons #### Simplifies fiber code - Current fiber code in `cont.c` is complicated by shared logic with continuations - Removing continuations will simplify stack management, context switching, and reduce edge cases - Ultimately leading to: cleaner code, easier maintenance, possible performance improvements #### Low compatibility risk - Major libraries (e.g., [Metasploit](https://github.com/rapid7/metasploit-framework/pull/2413)) stopped using continuation years ago - Projects needing this functionality have found workarounds (e.g., hyperion_http simulates `callcc`) - [TruffleRuby does not support continuations](https://github.com/oracle/truffleruby/blob/ac88a0fe68bf957f7…, yet maintains high compatibility ### Proposed steps 1. Remove the continuation gem from default gems. 2. Delete all continuation-specific code in `cont.c`. 3. Add a stub gem that raises an exception if continuations are used. 4. Optionally document alternative approaches for users who still need this feature. -- https://bugs.ruby-lang.org/
2 2
0 0
[ruby-core:121778] [Ruby Bug#21296] The builds of `RUBY_DEBUG` and `VM_CHECK_MODE` are broken
by hsbt (Hiroshi SHIBATA) 01 May '25

01 May '25
Issue #21296 has been reported by hsbt (Hiroshi SHIBATA). ---------------------------------------- Bug #21296: The builds of `RUBY_DEBUG` and `VM_CHECK_MODE` are broken https://bugs.ruby-lang.org/issues/21296 * Author: hsbt (Hiroshi SHIBATA) * Status: Open * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- `RUBY_DEBUG` and `VM_CHECK_MODE` are broken from 4-5 days ago. * https://github.com/ruby/ruby/actions/runs/14731314851/job/41346072323?pr=13… * https://github.com/ruby/ruby/actions/runs/14731314851/job/41346071897?pr=13… ``` /github/workspace/src/vm_core.h:1990: Assertion Failed: rb_current_execution_context:ec == rb_current_ec_noinline() ruby 3.5.0dev (2025-04-29T12:32:24Z pull/13200/merge 22fe2a6945) +PRISM [x86_64-linux] ``` I'm not sure what's root cause for that. But omnibus compilations 8 and 9 are broken since merging https://github.com/ruby/ruby/pull/13080. You can track that results from https://github.com/ruby/ruby/actions/workflows/compilers.yml -- https://bugs.ruby-lang.org/
2 2
0 0
[ruby-core:121769] [Ruby Bug#21293] C23/GCC 15 build breakage with rb_define_method() and friends
by alanwu (Alan Wu) 01 May '25

01 May '25
Issue #21293 has been reported by alanwu (Alan Wu). ---------------------------------------- Bug #21293: C23/GCC 15 build breakage with rb_define_method() and friends https://bugs.ruby-lang.org/issues/21293 * Author: alanwu (Alan Wu) * Status: Open * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- GCC 15 defaults to `-std=gnu23`, which breaks rb_define_method() in some corner cases: ```diff diff --git a/object.c b/object.c index 5a379e9..958f421 100644 --- a/object.c +++ b/object.c @@ -4613,7 +4613,8 @@ InitVM_Object(void) rb_cFalseClass = rb_define_class("FalseClass", rb_cObject); rb_cFalseClass_to_s = rb_fstring_enc_lit("false", rb_usascii_encoding()); rb_vm_register_global_object(rb_cFalseClass_to_s); - rb_define_method(rb_cFalseClass, "to_s", rb_false_to_s, 0); + int zero = 0; + rb_define_method(rb_cFalseClass, "to_s", rb_false_to_s, zero); rb_define_alias(rb_cFalseClass, "inspect", "to_s"); rb_define_method(rb_cFalseClass, "&", false_and, 1); rb_define_method(rb_cFalseClass, "|", false_or, 1); ``` Applying the above is fine prior to C23, but on GCC 15 it triggers a build error: ```text compiling object.c In file included from ./include/ruby/ruby.h:27, from constant.h:13, from object.c:22: object.c: In function 'InitVM_Object': ./include/ruby/internal/anyargs.h:288:135: error: passing argument 3 of 'rb_define_method_m3' from incompatible pointer type [-Wincompatible-pointer-types] 288 | #define rb_define_method(klass, mid, func, arity) RBIMPL_ANYARGS_DISPATCH_rb_define_method((arity), (func))((klass), (mid), (func), (arity)) | ^~~~~~ | | | VALUE (*)(VALUE) {aka long unsigned int (*)(long unsigned int)} object.c:4617:5: note: in expansion of macro 'rb_define_method' 4617 | rb_define_method(rb_cFalseClass, "to_s", rb_false_to_s, kek); | ^~~~~~~~~~~~~~~~ ./include/ruby/internal/anyargs.h:277:21: note: expected 'VALUE (*)(void)' {aka 'long unsigned int (*)(void)'} but argument is of type 'VALUE (*)(VALUE)' {aka 'long unsigned int (*)(long unsigned int)'} 277 | RBIMPL_ANYARGS_DECL(rb_define_method, VALUE, const char *) | ^~~~~~~~~~~~~~~~ ./include/ruby/internal/anyargs.h:252:41: note: in definition of macro 'RBIMPL_ANYARGS_DECL' 252 | RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _m3(__VA_ARGS__, VALUE(*)(ANYARGS), int); \ | ^~~ object.c:1605:1: note: 'rb_false_to_s' declared here 1605 | rb_false_to_s(VALUE obj) | ^~~~~~~~~~~~~ At top level: cc1: note: unrecognized command-line option '-Wno-self-assign' may have been intended to silence earlier diagnostics cc1: note: unrecognized command-line option '-Wno-parentheses-equality' may have been intended to silence earlier diagnostics cc1: note: unrecognized command-line option '-Wno-constant-logical-operand' may have been intended to silence earlier diagnostics make: *** [Makefile:464: object.o] Error 1 ``` This also happens for C method that takes a large number of arguments. This because in C23 `void foo();` no longers means "foo takes an unspecified number of arguments" anymore, and there is no way to implement a working `ANYARGS` AFAIK. Not something people would run into in practice, I hope. (related: #21286 but this one is not Windows specific) -- https://bugs.ruby-lang.org/
2 1
0 0
[ruby-core:121775] [Ruby Bug#21295] ruby/ruby-dev-builder - macos-13 debug build failures, stops GHA master build updates
by MSP-Greg (Greg L) 30 Apr '25

30 Apr '25
Issue #21295 has been reported by MSP-Greg (Greg L). ---------------------------------------- Bug #21295: ruby/ruby-dev-builder - macos-13 debug build failures, stops GHA master build updates https://bugs.ruby-lang.org/issues/21295 * Author: MSP-Greg (Greg L) * Status: Open * ruby -v: master * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- @Eregon [ruby/ruby-dev-builder](https://github.com/ruby/ruby-dev-builder) has issues turned off, which I can understand. It is the repo that creates the Ubuntu & macOS MRI master/head builds used in GHA (GitHub Actions). Recently, there have been test-all failures in the 'macos-13 debug' job. Also, the tests take longer to run than macos-14. I believe macos-13 is x64, macos-14 is arm64. It would certainly be nice to fix the problem. In at least a few workflow runs, it is the only job failure. A more significant issue is that any failure in the workflow's jobs stops a new release from being created. The 'macos-13 debug' jobs have failed on the last two days runs (it . Recently `Set` was updated, I believe it's been a few days, but I don't recall any API changes. I believe no tests were changed/added, but marshalling set was covered in test suites. Hence, that was overlooked, and a subsequent PR/commit fixed it. But, the first commit was done where a new release was created. Since the the 2nd commit was done, all the 'macos-13 debug' jobs have been failing. Hence, it's not available in GHA. So, there are two issues: 1. 'macos-13 debug' is failing test-all 2. ruby/ruby-dev-builder cannot update any master build if one or more of the master builds fail. -- https://bugs.ruby-lang.org/
3 5
0 0
[ruby-core:121727] [Ruby Feature#21284] Request: add `Array#pad` method
by MatzFan (Brian Cohen) 30 Apr '25

30 Apr '25
Issue #21284 has been reported by MatzFan (Brian Cohen). ---------------------------------------- Feature #21284: Request: add `Array#pad` method https://bugs.ruby-lang.org/issues/21284 * Author: MatzFan (Brian Cohen) * Status: Open ---------------------------------------- A method to pad an array of arbitrary length with objects up to a specified array size does not currently exist. `Array#fill` does not do this and I therefore propose the following method: ``` ruby class Array def pad(pad_to_length, object = nil) fill(object, size, pad_to_length - size) end end ``` I have provided an [answer](https://stackoverflow.com/a/79591610/4114896) to a Stack Overflow question asking how this can be done in Ruby. I've also explained in a comment on the answer which suggests using `Array#fill` why this does not meet the exact need. -- https://bugs.ruby-lang.org/
3 6
0 0
[ruby-core:121772] [Ruby Bug#21294] URI.extract is extracting invalid URIs with a mishmash of IPv6 notation with IPv4 address
by Keeyan (Keeyan Nejad) 30 Apr '25

30 Apr '25
Issue #21294 has been reported by Keeyan (Keeyan Nejad). ---------------------------------------- Bug #21294: URI.extract is extracting invalid URIs with a mishmash of IPv6 notation with IPv4 address https://bugs.ruby-lang.org/issues/21294 * Author: Keeyan (Keeyan Nejad) * Status: Open * ruby -v: ruby 3.4.3 (2025-04-14 revision d0b7e5b6a0) +PRISM [x86_64-linux] * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- The following is not a valid URI: `http://[127.0.0.1]`. So `URI.extract` should not extract it. It seems it is extracting it, though. So if you have code which extracts all URIs and then parses them, like the following, an error will be raised: ``` ruby require 'uri' URI.extract("Fake URL: http://[127.0.0.1]" , :http).each do |uri| # => ['http://[127.0.0.1]'] URI.parse(uri) # => raise URI::InvalidURIError end ``` ``` /home/keeyan/.local/share/mise/installs/ruby/3.4.3/lib/ruby/3.4.0/uri/rfc3986_parser.rb:130:in 'URI::RFC3986_Parser#split': bad URI (is not URI?): "http://[127.0.0.1]" (URI::InvalidURIError) from /home/keeyan/.local/share/mise/installs/ruby/3.4.3/lib/ruby/3.4.0/uri/rfc3986_parser.rb:135:in 'URI::RFC3986_Parser#parse' from /home/keeyan/.local/share/mise/installs/ruby/3.4.3/lib/ruby/3.4.0/uri/common.rb:212:in 'URI.parse' from test.rb:4:in 'block in <main>' from test.rb:3:in 'Array#each' from test.rb:3:in '<main>' ``` Instead, I believe `URI.extract`, should return an empty array. -- https://bugs.ruby-lang.org/
2 2
0 0
[ruby-core:121762] [Ruby Bug#21292] wrong number of arguments (given 2, expected 0) (ArgumentError) since 8ac8225c504dee57454131e7cde2c47126596fdc
by yahonda (Yasuo Honda) 29 Apr '25

29 Apr '25
Issue #21292 has been reported by yahonda (Yasuo Honda). ---------------------------------------- Bug #21292: wrong number of arguments (given 2, expected 0) (ArgumentError) since 8ac8225c504dee57454131e7cde2c47126596fdc https://bugs.ruby-lang.org/issues/21292 * Author: yahonda (Yasuo Honda) * Status: Open * ruby -v: ruby 3.5.0dev (2025-04-25T20:46:05Z master 8ac8225c50) +PRISM [x86_64-linux] * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- Rails CI against Ruby master branch has been failing https://buildkite.com/rails/rails-nightly/builds/2129#019673e6-eed1-4ce3-94… According to git bisect, this behavior change has been introduced via 8ac8225c504dee57454131e7cde2c47126596fdc and I think I have managed to reproduce it. ### Steps to reproduce 1. Create foo.rb ```ruby class Foo def initialize @foo = nil end class << self private def method_missing(method_name, ...) Bar.new(self, method_name, ...) end # Workaround for Ruby 3.5.0 # def method_missing(method_name, *args, &block) # Bar.new(self, method_name, *args, &block) # end end end class Bar def initialize(class_name, action, *args) @class_name = class_name @action = action @args = args end end p RUBY_VERSION foo = Foo.hello p foo ``` 2. Run this foo.rb ``` $ ruby foo.rb ``` ### Expected behavior It should show the Ruby version and local variable foo as Ruby 3.4.3 does ```ruby $ ruby -v ruby 3.4.3 (2025-04-14 revision d0b7e5b6a0) +PRISM [x86_64-linux] $ ruby foo.rb "3.4.3" #<Bar:0x00007f130ed47bc8 @class_name=Foo, @action=:hello, @args=[]> $ ``` ### Actual behavior It raises the wrong number of arguments (given 2, expected 0) (ArgumentError) ```ruby $ ruby -v ruby 3.5.0dev (2025-04-25T20:46:05Z master 8ac8225c50) +PRISM [x86_64-linux] $ ruby foo.rb "3.5.0" foo.rb:2:in 'initialize': wrong number of arguments (given 2, expected 0) (ArgumentError) from foo.rb:10:in 'Foo.method_missing' from foo.rb:29:in '<main>' $ ``` ### Additional information 1. To workaround this error, update the method_missing signature as follows. ``` def method_missing(method_name, *args, &block) Bar.new(self, method_name, *args, &block) end ```` 2. This does not reproduce against e0545a0250 that is the parent commit of 8ac8225 ```ruby $ ruby -v ruby 3.5.0dev (2025-04-25T18:04:45Z master e0545a0250) +PRISM [x86_64-linux] $ ruby foo.rb "3.5.0" #<Bar:0x00007f3ac640f8a0 @class_name=Foo, @action=:hello, @args=[]> $ ``` -- https://bugs.ruby-lang.org/
3 2
0 0
[ruby-core:121757] [Ruby Bug#21291] possible bug with /m regexp and $ based on input
by zenspider (Ryan Davis) 29 Apr '25

29 Apr '25
Issue #21291 has been reported by zenspider (Ryan Davis). ---------------------------------------- Bug #21291: possible bug with /m regexp and $ based on input https://bugs.ruby-lang.org/issues/21291 * Author: zenspider (Ryan Davis) * Status: Open * ruby -v: 3.4.2 * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- reported in discord by the.unnamed user: ``` ruby #!/usr/bin/env -S ruby -vw # => ruby 3.4.2 (2025-02-15 revision d2930f8e7a) +PRISM [arm64-darwin24] p "a\n" =~ /$./m # => 1 p "a\n" =~ /$.*/m # => 1 p "aa\n" =~ /$./m # => 2 p "aa\n" =~ /$.*/m # !!! # => nil p "aa\n" =~ /$[\S\s]*/m # => 2 ``` goes back to at least 3.2.8 -- https://bugs.ruby-lang.org/
3 2
0 0
[ruby-core:121747] [Ruby Bug#21288] StringScanner#named_captures overrides matched captures with unmatched captures
by robotdana (Dana Sherson) 28 Apr '25

28 Apr '25
Issue #21288 has been reported by robotdana (Dana Sherson). ---------------------------------------- Bug #21288: StringScanner#named_captures overrides matched captures with unmatched captures https://bugs.ruby-lang.org/issues/21288 * Author: robotdana (Dana Sherson) * Status: Open * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- StringScanner#named_captures operates inconsistently with Regexp#named_captures when there is the same name used in multiple branches For Regexp it uses the value that was captured (useful). For StringScanner it uses the one last in source order. ```ruby require 'strscan' re = /(?<test>value)|(?<test>other branch)/ scanner = StringScanner.new("value") scanner.scan(re) scanner.named_captures #=> {"test" => nil} "value".match(re).named_captures # => {"test" => "test"} scanner = StringScanner.new('other branch') scanner.scan(re) scanner.named_captures #=> {"test" => "other branch"} "other branch".match(re).named_captures # => {"test" => "other branch"} ``` -- https://bugs.ruby-lang.org/
3 2
0 0
  • ← Newer
  • 1
  • ...
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • ...
  • 417
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.