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
  • ----- 2025 -----
  • 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

January 2023

  • 6 participants
  • 252 discussions
[ruby-core:111456] [Ruby master Bug#19271] irb ignores rbs and debug with YJIT enabled
by olivierlacan (Olivier Lacan) 18 Jan '23

18 Jan '23
Issue #19271 has been reported by olivierlacan (Olivier Lacan). ---------------------------------------- Bug #19271: irb ignores rbs and debug with YJIT enabled https://bugs.ruby-lang.org/issues/19271 * Author: olivierlacan (Olivier Lacan) * Status: Open * Priority: Normal * ruby -v: ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [arm64-darwin21] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- Not sure this is a serious issue but when starting IRB with YJIT enabled this (potentially confusing) message is immediately printed: ``` $ RUBY_YJIT_ENABLE=1 irb Ignoring debug-1.7.1 because its extensions are not built. Try: gem pristine debug --version 1.7.1 Ignoring rbs-2.8.2 because its extensions are not built. Try: gem pristine rbs --version 2.8.2 irb(main):001:0> ``` This is on a fresh installation of Ruby 3.2.0 with an empty Gemfile in the directory. I haven't run gem pristine on any gem since I hadn't installed any gems after installing Ruby 3.2.0 here but FYI: ``` $ gem list | grep "rbs\|debug" debug (1.7.1) rbs (2.8.2) ``` This seems to suggest that C extensions weren't built for those gems when they were installed during the Ruby installation process. Just to be safe I checked and while I do use rbenv and ruby-build to compile and manage Rubies, I don't have a default gem installer set up so as far as I know these gems weren't installed by my system. -- https://bugs.ruby-lang.org/
6 8
0 0
[ruby-core:111573] [Ruby master Bug#19298] `lib/mjit/instruction.rb` was reintroduced by merge mistake
by vo.x (Vit Ondruch) 18 Jan '23

18 Jan '23
Issue #19298 has been reported by vo.x (Vit Ondruch). ---------------------------------------- Bug #19298: `lib/mjit/instruction.rb` was reintroduced by merge mistake https://bugs.ruby-lang.org/issues/19298 * Author: vo.x (Vit Ondruch) * Status: Open * Priority: Normal * ruby -v: ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-linux] * Backport: 2.7: DONTNEED, 3.0: DONTNEED, 3.1: DONTNEED, 3.2: REQUIRED ---------------------------------------- It seems that `lib/mjit/instruction.rb` should not be shipped anymore since commit:git|bb4cbd0803c3297ad036008adc7a01159ce44e1e, but it was re-introduced into the repository by merge mistake commit:git|f6620037ba1477d2c337d7b511f094d6d0fbb69c. Actually, it was probably never part of the repository, but was part of the tarball, but it seems it should not be. -- https://bugs.ruby-lang.org/
4 3
0 0
[ruby-core:111800] [Ruby master Bug#19336] Backport commit eab7f4623fbf0488e828b75843d70c8e02dc8aa5
by byroot (Jean Boussier) 18 Jan '23

18 Jan '23
Issue #19336 has been reported by byroot (Jean Boussier). ---------------------------------------- Bug #19336: Backport commit eab7f4623fbf0488e828b75843d70c8e02dc8aa5 https://bugs.ruby-lang.org/issues/19336 * Author: byroot (Jean Boussier) * Status: Closed * Priority: Normal * Backport: 2.7: DONTNEED, 3.0: DONTNEED, 3.1: DONTNEED, 3.2: REQUIRED ---------------------------------------- This commit fix a potential VM crash when profiling. -- https://bugs.ruby-lang.org/
2 1
0 0
[ruby-core:111571] [Ruby master Bug#19296] Time.new's argument check is incomplete
by matsuda (Akira Matsuda) 18 Jan '23

18 Jan '23
Issue #19296 has been reported by matsuda (Akira Matsuda). ---------------------------------------- Bug #19296: Time.new's argument check is incomplete https://bugs.ruby-lang.org/issues/19296 * Author: matsuda (Akira Matsuda) * Status: Open * Priority: Normal * ruby -v: ruby 3.3.0dev (2023-01-01T07:39:00Z master 542e984d82) +YJIT [arm64-darwin21] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- `Time.new` seems to be performing some sort of argument checking, but I found some strings that can bypass this validation and craft erroneous Time value. - month ``` '12'.upto('20').each do |m| str = "2023-#{m}-01" puts str begin p Time.new str rescue => e p e end puts end ``` ``` # result 2023-12-01 2023-12-01 00:00:00 +0900 2023-13-01 #<ArgumentError: mon out of range> 2023-14-01 #<ArgumentError: mon out of range> 2023-15-01 #<ArgumentError: mon out of range> 2023-16-01 #<ArgumentError: mon out of range> 2023-17-01 2023-01-01 00:00:00 +0900 2023-18-01 2023-02-01 00:00:00 +0900 2023-19-01 2023-03-01 00:00:00 +0900 2023-20-01 2023-04-01 00:00:00 +0900 ``` - day ``` $ ruby -e 'p Time.new("2023-01-31")' 2023-01-31 00:00:00 +0900 $ ruby -e 'p Time.new("2023-01-32")' <internal:timev>:398:in `initialize': mday out of range (ArgumentError) from -e:1:in `new' from -e:1:in `<main>' $ ruby -e 'p Time.new("2023-01-33")' 2023-01-01 00:00:00 +0900 $ ruby -e 'p Time.new("2023-01-34") 2023-01-02 00:00:00 +0900 ``` In conclusion, month seeems to raise only when the given value is <= 16, and day seems to be checked for <= 32 only. -- https://bugs.ruby-lang.org/
3 2
0 0
[ruby-core:111441] [Ruby master Bug#19264] Backport 9f2378959e5c5b5c39c9993f1a84e5304ff113d6
by nagachika (Tomoyuki Chikanaga) 18 Jan '23

18 Jan '23
Issue #19264 has been reported by nagachika (Tomoyuki Chikanaga). ---------------------------------------- Bug #19264: Backport 9f2378959e5c5b5c39c9993f1a84e5304ff113d6 https://bugs.ruby-lang.org/issues/19264 * Author: nagachika (Tomoyuki Chikanaga) * Status: Closed * Priority: Normal * Backport: 3.0: REQUIRED, 3.1: REQUIRED, 3.2: REQUIRED ---------------------------------------- This is a ticket for backport management. 9f2378959e5c5b5c39c9993f1a84e5304ff113d6 may need to be backported. https://github.com/ruby/ruby/pull/7023 -- https://bugs.ruby-lang.org/
2 1
0 0
[ruby-core:111857] [Ruby master Bug#19349] Kernel.Integer silently discards base argument that does not have a #to_int
by herwin (Herwin W) 18 Jan '23

18 Jan '23
Issue #19349 has been reported by herwin (Herwin W). ---------------------------------------- Bug #19349: Kernel.Integer silently discards base argument that does not have a #to_int https://bugs.ruby-lang.org/issues/19349 * Author: herwin (Herwin W) * Status: Open * Priority: Normal * ruby -v: ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux-gnu] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- The method `Kernel.Integer` has an optional argument `base`, which is the base to convert the input to: ``` irb(main):001:0> Kernel.Integer('10', 8) => 8 ``` If the base argument is not an integer, it is converted using `#to_int` ``` irb(main):002:0> Kernel.Integer('10', 8.2) => 8 irb(main):003:0> Kernel.Integer('10', Object.new.tap { |x| x.define_singleton_method(:to_int) { 8 } }) => 8 ``` But if the base argument is not an Integer, and does not have a `#to_int` method, it gets discarded ``` irb(main):004:0> Kernel.Integer('10', '8') => 10 ``` I would expect this to raise a `TypeError`, similar to `String#to_i`: ``` irb(main):005:0> '10'.to_i('8') (irb):5:in `to_i': no implicit conversion of String into Integer (TypeError) ``` This has briefly been discussed on the ruby-spec github repo, and they suggested to report this as a bug. (see https://github.com/ruby/spec/pull/997#issuecomment-1382825900) -- https://bugs.ruby-lang.org/
2 2
0 0
[ruby-core:111864] [Ruby master Bug#11230] Should rb_struct_s_members() be public API?
by jeremyevans0 (Jeremy Evans) 17 Jan '23

17 Jan '23
Issue #11230 has been updated by jeremyevans0 (Jeremy Evans). I submitted a pull request to remove the prototype from the public header files: https://github.com/ruby/ruby/pull/7141 `rb_struct_s_members` is still an exported symbol as it is used internally by `marshal.c`. One of reasons stated to remove this method is that it returns a hidden Array. However, `rb_struct_members` appears to return the same hidden Array (that method is also used internally by `marshal.c`). Should we consider removing `rb_struct_members` from the public API as well? ---------------------------------------- Bug #11230: Should rb_struct_s_members() be public API? https://bugs.ruby-lang.org/issues/11230#change-101278 * Author: Eregon (Benoit Daloze) * Status: Open * Priority: Normal * ruby -v: ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- rb_struct_s_members() is declared in include/ruby/intern.h. However it seems this is a fairly internal API as it returns an hidden Array. For instance, there was a try to specify the behavior in https://github.com/rubinius/rubinius/commit/2642a30c57973987d2a7b7e85b3ce1e… but that produces only erratic behavior on MRI because that usage is not intended. A valid usage might be: static VALUE get_struct_member(VALUE self, VALUE obj, VALUE i) { return RARRAY_AREF(rb_struct_s_members(obj), NUM2INT(i)); } p get_struct_member(Struct.new(:a, :bb), 1) But do we need such access and is it worth exposing a potentially dangerous function like this? -- https://bugs.ruby-lang.org/
1 0
0 0
[ruby-core:111861] [Ruby master Feature#8827] A method that flips the receiver and the first argument
by sawa (Tsuyoshi Sawada) 17 Jan '23

17 Jan '23
Issue #8827 has been updated by sawa (Tsuyoshi Sawada). Since `then` has been introduced, I think using that is more straightforward. I withdraw this feature. Please close it. ---------------------------------------- Feature #8827: A method that flips the receiver and the first argument https://bugs.ruby-lang.org/issues/8827#change-101274 * Author: sawa (Tsuyoshi Sawada) * Status: Open * Priority: Normal ---------------------------------------- =begin If it often happens that we need to pass to a method an argument that is the result of a long chain of operations: Hash[some_chain_of_operations_that_ends_up_with_an_array] File.read(some_chain_of_operations_that_ends_up_with_a_string) YAML.dump(some_chain_of_operations_that_ends_up_with_an_object) ... I believe one basic tenet of Ruby is to encourage method chaining, but that practice is discouraged in the examples above. It would be convenient if there is a method (let us call this `Object#flip`) that flips the receiver and the first argument and sends the method so that the examples above can be written as follows: some_chain_of_operations_that_ends_up_with_an_array.flip(Hash, :[]) some_chain_of_operations_that_ends_up_with_a_string.flip(File, :read) some_chain_of_operations_that_ends_up_with_an_object.flip(YAML, :dump) ... The implementation in Ruby may be as follows: class Object def flip receiver, method, *rest, &pr receiver.send(method, self, *rest, &pr) end end It would be good if we can have that as a built-in Ruby method. =end -- https://bugs.ruby-lang.org/
1 0
0 0
[ruby-core:111859] [Ruby master Feature#15381] Let double splat call `to_h` implicitly
by sawa (Tsuyoshi Sawada) 17 Jan '23

17 Jan '23
Issue #15381 has been updated by sawa (Tsuyoshi Sawada). This feature has already been realized at some point (although I cannot specify which Ruby version first introduced this). Please close this issue. ---------------------------------------- Feature #15381: Let double splat call `to_h` implicitly https://bugs.ruby-lang.org/issues/15381#change-101272 * Author: sawa (Tsuyoshi Sawada) * Status: Open * Priority: Normal ---------------------------------------- The single splat calls `to_a` implicitly on the object (if it is not an array already) so that, for example, we have the convenience of writing conditions in an array literal: ```ruby a = [ *(:foo if some_condition), *(:bar if another_condition), ] ``` And the ampersand implicitly calls `to_proc` on the object (if it is not a proc already) so that we can substitute a block with an ampersand followed by a symbol: ```ruby some_method(&:some_method_name) ``` Unlike the single splat and ampersand, the double splat does not seem to implicitly call a corresponding method. I propose that the double splat should call `to_h` implicitly on the object if it not already a Hash so that we can, for example, write a condition in a hash literal as follows: ```ruby h = { **({a: 1} if some_condition), **({b: 2) if another_condition), } ``` There may be some other benefits of this feature that I have not noticed yet. -- https://bugs.ruby-lang.org/
1 0
0 0
[ruby-core:111838] [Ruby master Feature#19346] Add Ractor escape Ractor.disable_isolation_checks! { }
by luke-gru (Luke Gruber) 17 Jan '23

17 Jan '23
Issue #19346 has been reported by luke-gru (Luke Gruber). ---------------------------------------- Feature #19346: Add Ractor escape Ractor.disable_isolation_checks! { } https://bugs.ruby-lang.org/issues/19346 * Author: luke-gru (Luke Gruber) * Status: Open * Priority: Normal ---------------------------------------- It would be nice to be able to autoload constants inside Ractors. I'm not sure why this is disabled right now because if autoloading is working properly inside threads then my initial thought is that the autoload implementation should work inside Ractors. I guess there's different parts to this: registering the autoload: ```ruby Ractor.new { autoload :MyClass, 'myclass' } ``` Kicking off the autoload require ```ruby Ractor.new { MyClass } ``` This leads to the problem of calling rubygems `require` inside Ractors, as rubygems is not Ractor safe. However, it's thread-safe so it should be able to be ractor safe too (we don't need the ractor isolation checks in rubygems require). What if there was an API: ```ruby Ractor.disable_isolation_checks! do "..." end ``` It would disable all Ractor isolation errors inside the block. Rubygems could be patched easily and other gems too that are thread-safe and use synchronization around the class ivars and constants. Of course it could be abused and would have to be used properly. Well it's just an idea, I'm sure other people have had the same idea before. -- https://bugs.ruby-lang.org/
2 2
0 0
  • ← Newer
  • 1
  • ...
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • ...
  • 26
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.