Project

General

Profile

Activity

From 03/27/2021 to 04/02/2021

04/02/2021

11:57 PM Misc #17734: DevelopersMeeting20210416Japan
* [Feature #17749] Add `Module#source_location`
* It's similar to the const_source_location feature, but easier to use when you don't know the constant name, or enclosing const
* This is useful for debugging
* [Feature #17753]...
tenderlovemaking (Aaron Patterson)
10:13 PM Misc #17734: DevelopersMeeting20210416Japan
* [Bug #17398] SyntaxError in endless method (jeremyevans0)
* I don't believe this is a bug, but maybe it is a useful feature.
* @mame has a patch that allows commands as the RHS of a endless method.
* However, @mame's patch doe...
jeremyevans0 (Jeremy Evans)
09:41 PM Misc #17733 (Closed): Add peterzhu2118 as a committer
jeremyevans0 (Jeremy Evans)
09:39 PM Bug #17767: `Cloned ENV` inconsistently returns `ENV` or `self`
I don't think it makes sense to have cloned ENV objects. I propose the following behavior:
* `ENV.dup`/`ENV.clone`/`ENV.clone(freeze: nil)`/`ENV.clone(freeze: false)` should return `ENV`, since the same singleton storage is used (the...
jeremyevans0 (Jeremy Evans)
08:53 PM Bug #17770 (Third Party's Issue): Assets precompilation aborts with Segmentation fault
This does appear to be a sassc bug: https://github.com/sass/sassc-ruby/issues/207 jeremyevans0 (Jeremy Evans)
07:42 PM Feature #17472: HashWithIndifferentAccess like Hash extension
And people should likely recall the reasons for the existence of symbols and strings. Originally strings were very expensive and not deduplicated, but were garbage collected. While symbols were very cheap, deduplicated and frozen and n... lamont (Lamont Granquist)
07:34 PM Feature #17472: HashWithIndifferentAccess like Hash extension
Any implementation should probably consider recursive structures under arrays and all the mutator methods on Array:
``` ruby
% pry
[1] pry(main)> require 'active_support/hash_with_indifferent_access'
=> true
[2] pry(main)> test = ...
lamont (Lamont Granquist)
02:13 PM Feature #17472: HashWithIndifferentAccess like Hash extension
lamont (Lamont Granquist) wrote in #note-24:
> Although I really need to be able to inherit from the class and wrap convert_key/convert_value and it would be useful to have a private regular_writer/regular_update bypass (for performance...
Dan0042 (Daniel DeLorme)
01:45 PM Feature #17472: HashWithIndifferentAccess like Hash extension
sawa (Tsuyoshi Sawada) wrote in #note-25:
> I am surprised and am sad that so many of the core developers are positive on this.
Why? I understand you passionately disagree with this. But it could be the people having a problem with h...
joelb (Joel Blum)
04:11 AM Feature #17472: HashWithIndifferentAccess like Hash extension
I am surprised and am sad that so many of the core developers are positive on this. sawa (Tsuyoshi Sawada)
04:28 PM Revision 8a4472fb (git): [ruby/reline] Version 0.2.5
https://github.com/ruby/reline/commit/22ce5651e5 aycabta (aycabta .)
04:25 PM Revision 3ffb0447 (git): [ruby/irb] Version 1.3.5
https://github.com/ruby/irb/commit/22e2ddf715 aycabta (aycabta .)
04:22 PM Revision 64b991b0 (git): [ruby/rdoc] Links to document texts without "rdoc-ref:" prefix
While links to generated HTML from RDoc file needs to be prefixed
by "rdoc-ref:" currently, in case of explicit references this
seems just redundant.
Also GitHub RDoc support does not work with this prefix.
This patch lets links to suc...
nobu (Nobuyoshi Nakada)
04:22 PM Revision a6948329 (git): [ruby/rdoc] Clarify that dots in URL are replaced
The dots in all path components from the document root are
replaced with underscores, not only in the basename.
https://github.com/ruby/rdoc/commit/7a3417ea4c
nobu (Nobuyoshi Nakada)
04:21 PM Revision 61e1cf23 (git): [ruby/rdoc] Treat emphasis tags as excluding other notations
And exclusive notations don't exclude other exclusive notations.
https://github.com/ruby/rdoc/commit/b8baa9a435
aycabta (aycabta .)
04:21 PM Revision e84d275f (git): [ruby/rdoc] Treat other tags as word boundaries
https://github.com/ruby/rdoc/commit/8222f85a17 aycabta (aycabta .)
04:21 PM Revision 54aa11ef (git): [ruby/rdoc] Disable other notations in <code> tags
https://github.com/ruby/rdoc/commit/0cd3b55210 aycabta (aycabta .)
04:17 PM Revision ab89c45b (git): [ruby/irb] Evaluate each toplevel statement
https://github.com/ruby/irb/commit/bc1b1d8bc3 aycabta (aycabta .)
04:15 PM Revision 254cd937 (git): [ruby/irb] Add test for multiline paste
https://github.com/ruby/irb/commit/e93c9cb54d aycabta (aycabta .)
04:14 PM Revision 0eb14919 (git): [ruby/irb] Add yamatanooroti test example
https://github.com/ruby/irb/commit/279155fcee aycabta (aycabta .)
03:49 PM Revision 9de00864 (git): * 2021-04-03 [ci skip]
git[bot]
03:49 PM Revision 3cab8c08 (git): [ruby/irb] process multi-line pastes as a single entity
this allows pasting leading-dot chained methods correctly:
```ruby
class A
def a; self; end
def b; true; end
end
a = A.new
a
.a
.b
```
will properly return `true` instead of erroring on the `.a` line:
```
irb(main):001:1* ...
Cody Cutrer
03:39 PM Feature #17773: Alias `Numeric#zero?` and `Float#zero?` as `Numeric#empty?` and `Float#empty?`
An example of using `-1` as a default-ish integer value is to indicate "item not found" in a C-like language (see https://en.wikipedia.org/wiki/Sentinel_value).
The following example seems to suggest that Ruby treats `0` as a default-...
xtkoba (Tee KOBAYASHI)
02:40 PM Feature #17773: Alias `Numeric#zero?` and `Float#zero?` as `Numeric#empty?` and `Float#empty?`
You may be right that zero is not (the only) special (element). In fact, one is the unit element for multiplication whereas zero is the unit element for addition. But still, addition is the first operation, and is more prominent than mul... sawa (Tsuyoshi Sawada)
10:09 AM Feature #17773: Alias `Numeric#zero?` and `Float#zero?` as `Numeric#empty?` and `Float#empty?`
Same feeling here, empty? should be reserved for collections with elements.
Input fields from a website are always Strings initially, and should be checked as Strings (e.g., input.strip.empty?) for provided/not-provided.
The user mig...
Eregon (Benoit Daloze)
07:21 AM Feature #17773: Alias `Numeric#zero?` and `Float#zero?` as `Numeric#empty?` and `Float#empty?`
I'm also against this proposal.
I do not believe that there are many cases where one checks for `.zero?` || `.empty?`. Note that `nil` nor `false` implement either.
If you need something like `blank?` or `trivial?` or similar, refi...
marcandre (Marc-Andre Lafortune)
06:21 AM Feature #17773: Alias `Numeric#zero?` and `Float#zero?` as `Numeric#empty?` and `Float#empty?`
I don't think these aliases are useful for most cases so it is inappropriate as a default-provided feature.
I agree there are cases that zero means empty, but there are also cases that -1 or other numbers mean empty. I don't think the z...
mrkn (Kenta Murata)
05:42 AM Feature #17773: Alias `Numeric#zero?` and `Float#zero?` as `Numeric#empty?` and `Float#empty?`
jeremyevans0 (Jeremy Evans) wrote in #note-2:
> If you are checking for user input, aliasing `zero?` to `empty?` seems wrong, as `0` is a valid non-empty user input.
I do not understand what you exactly mean by 0 is valid. But presumabl...
sawa (Tsuyoshi Sawada)
05:23 AM Feature #17773: Alias `Numeric#zero?` and `Float#zero?` as `Numeric#empty?` and `Float#empty?`
jeremyevans0 (Jeremy Evans) wrote in #note-2:
> Can you provide a reference to a set theoretic definition of the number 0 as the empty set?
Here is a Wikipedia article:
https://en.wikipedia.org/wiki/Set-theoretic_definition_of_nat...
sawa (Tsuyoshi Sawada)
04:24 AM Feature #17773: Alias `Numeric#zero?` and `Float#zero?` as `Numeric#empty?` and `Float#empty?`
I'm against this. `empty?` exists on collection classes, and numbers are not collections, nor sets. Can you provide a reference to a set theoretic definition of the number 0 as the empty set? Even if so, most Ruby programmers are not w... jeremyevans0 (Jeremy Evans)
03:49 AM Feature #17773 (Open): Alias `Numeric#zero?` and `Float#zero?` as `Numeric#empty?` and `Float#empty?`
When dealing with user input fields as in web applications, there are typical values that we want to consider as the default and/or absence of user input. For string/text inputs, list items, and attributes, we have `String#empty?`, `Arra... sawa (Tsuyoshi Sawada)
02:49 PM Feature #17771: String#start_with? should not construct MatchData or set $~
I also believe it is unintended behavior and should be removed. marcandre (Marc-Andre Lafortune)
10:28 AM Feature #17771: String#start_with? should not construct MatchData or set $~
I don't think there is a rule that predicate methods only return a boolean and never set `$~`.
It is the case for `String#match` vs `String#match?`, but it doesn't mean it holds for other Regexp methods.
I see it a bit like the use of ...
Eregon (Benoit Daloze)
02:21 PM Bug #17772: Performance issue with NameError message in context with large instance variables (not caused by did_you_mean)
The slowness is caused by a large amount of allocations required to build the error message. Consider the following script:
```ruby
class Environment
def run
@data = (1..5_000_000).to_h {|x| [x, x]}
trigger_name_error
...
peterzhu2118 (Peter Zhu)
12:13 PM Feature #17768 (Rejected): Proposal: Downward assignments
I think April 1st ended in the world. I hope you enjoyed it! mame (Yusuke Endoh)
11:31 AM Bug #17746: Backport f9f13a4f6d8be706b17efc089c28f7bc617ef549 to Ruby 3.0
ruby_3_0 0315e1e5ca0722f9dffeae70b860c19de303e339 merged revision(s) f9f13a4f6d8be706b17efc089c28f7bc617ef549. naruse (Yui NARUSE)
11:31 AM Bug #17732: rb_enc_interned_str crashes if called with a not yet loaded encoding
ruby_3_0 4e2738f477b5343a0d48a400c975220fed123c9b merged revision(s) 7e8a9af9db42a21f6a1125a29e98c45ff9d5833b. naruse (Yui NARUSE)
11:31 AM Bug #17754: NoMethodError#to_s makes segmentation fault when Module#name returns non string value
ruby_3_0 6abb8ee711a941b7ad31d21fdb429750f7ea4463 merged revision(s) 0a544c0c35f7445d69402d7c53d825384c728017. naruse (Yui NARUSE)
10:55 AM Bug #16651: Extensions Do Not Compile on Mingw64 with mingw32-make
This issue is related to commit commit:389157d8cfab7b6e84cdcdb2863421bd2c93bd7f, which merged the patch posted as [[ruby-core:21448]](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/21448). The description of the patch reads ... xtkoba (Tee KOBAYASHI)
08:45 AM Bug #16651: Extensions Do Not Compile on Mingw64 with mingw32-make
When running msys2 (ie, in an open console) the /c/ notation does work.
But it does not work in makefiles processed by mingw64. If you look at the makefiles that extconf.rb generates, they use paths like c:/abc/def *except* for this o...
cfis (Charlie Savage)
08:41 AM Bug #17643: Ruby 3 embedded - no GC methods?
Screenshot cfis (Charlie Savage)
08:39 AM Bug #17643: Ruby 3 embedded - no GC methods?
@nobu - Sorry that I missed your feedback.
I updated the code to call ruby_options, but that just hangs the interpreter. It thinks it is going to run a ruby script, but that is not correct. I have attached a screenshot of the call sta...
cfis (Charlie Savage)
08:33 AM Revision 7e939174 (git): [ruby/reline] Reset @rest_height when clear screen
https://github.com/ruby/reline/commit/3a7019b0d5 aycabta (aycabta .)
07:40 AM Revision 9e336f73 (git): [ruby/irb] Add show_source command
https://github.com/ruby/irb/commit/108cb04352 k0kubun (Takashi Kokubun)
07:09 AM Revision 6abb8ee7 (git): merge revision(s) 0a544c0c35f7445d69402d7c53d825384c728017: [Backport #17754]
Fix segmentation fault when `Module#name` returns non string value
[Bug #17754]
* Add test for NoMethodError#to_s does not segfault
* Ensure no segfault even if Module#name is overridden
---
er...
naruse (Yui NARUSE)
07:08 AM Revision 0315e1e5 (git): merge revision(s) f9f13a4f6d8be706b17efc089c28f7bc617ef549: [Backport #17746]
Ensure that caller respects the start argument
Previously, if there were ignored frames (iseq without pc), we could
go beyond the requested start frame. This has two changes:
1) Ensure that we don't look beyond...
naruse (Yui NARUSE)
07:06 AM Revision 4e2738f4 (git): merge revision(s) 7e8a9af9db42a21f6a1125a29e98c45ff9d5833b: [Backport #17732]
rb_enc_interned_str: handle autoloaded encodings
If called with an autoloaded encoding that was not yet
initialized, `rb_enc_interned_str` would crash with
a NULL pointer exception.
See: https://github.c...
naruse (Yui NARUSE)
07:01 AM Bug #17729: Fix infinite loop when parsing RUBYLIB with locale-invalid bytes
ruby_3_0 1a47de64f44da6d4339ba8b2c5220eeaba82954c merged revision(s) f748b911c9157a0bb86f38280ddfba72a55049b6. naruse (Yui NARUSE)
07:01 AM Bug #17519: set_visibility fails when a prepended module and a refinement both exist
ruby_3_0 d1cec0bca588266b9af1d55e592016c45ee68fbb merged revision(s) 58660e943488778563b9e41005a601e9660ce21f. naruse (Yui NARUSE)
07:01 AM Bug #17731: Integer downflow with inject/reduce
ruby_3_0 855401da495117fcf5d258fe43b71010abc43d9a merged revision(s) a85ed626f18d1014d09fb37eb0a703976c3d2b53. naruse (Yui NARUSE)
05:17 AM Revision 43e0677c (git): Fill the ring-buffer with the fallback value
Fill with the pointer to the root position, instead of zero and
comparing later. Also suppress a false warning by Visual C++.
```
file.c(4759): warning C4090: 'function': different 'const' qualifiers
```
nobu (Nobuyoshi Nakada)
03:31 AM Revision 855401da (git): merge revision(s) a85ed626f18d1014d09fb37eb0a703976c3d2b53: [Backport #17731]
Fix Enumerable#inject with high negative fixnums [Bug #17731]
---
enum.c | 2 +-
test/ruby/test_enum.rb | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
naruse (Yui NARUSE)
03:27 AM Revision 1a47de64 (git): merge revision(s) f748b911c9157a0bb86f38280ddfba72a55049b6: [Backport #17729]
Fix infinite loop at illegal sequence [Bug #17729]
As mblen returns -1 on failure, skip the first byte and try the
succeeding bytes in that case.
Close https://github.com/ruby/ruby/pull/4281
---
...
naruse (Yui NARUSE)
03:26 AM Revision d1cec0bc (git): merge revision(s) 58660e943488778563b9e41005a601e9660ce21f: [Backport #17519]
Skip refined method when exporting methods with changed visibility
Previously, attempting to change the visibility of a method in a
singleton class for a class/module that is prepended to and refined
would raise ...
naruse (Yui NARUSE)
01:52 AM Revision 79af8ce6 (git): [ruby/irb] Colorize `__END__` as keyword
https://github.com/ruby/irb/commit/9b84018311 nobu (Nobuyoshi Nakada)
12:25 AM Bug #17105 (Closed): A single `return` can return to two different places in a proc inside a lambda inside a method
Applied in changeset commit:git|ecfa8dcdbaf60cbe878389439de9ac94bc82e034.
----------
fix return from orphan Proc in lambda
A "return" statement in a Proc in a lambda like:
`lambda{ proc{ return }.call }`
should return outer lambda bl...
ko1 (Koichi Sasada)
12:25 AM Revision ecfa8dcd (git): fix return from orphan Proc in lambda
A "return" statement in a Proc in a lambda like:
`lambda{ proc{ return }.call }`
should return outer lambda block. However, the inner Proc can become
orphan Proc from the lambda block. This "return" escape outer-scope
like method, but ...
ko1 (Koichi Sasada)

04/01/2021

09:49 PM Feature #17472: HashWithIndifferentAccess like Hash extension
+1 on adding this.
There are any number of bugs which are caused by reading mixed symbols and strings into Hashes, then round tripping them through JSON and having them change one way or the other.
I mildly disliked the use of Mash...
lamont (Lamont Granquist)
08:51 PM Bug #12689: Thread isolation of $~ and $_
Also note this experimental PR that eliminates the update of `$~` from String#split, since no specs and no tests check that behavior and it seems unexpected and unpredictable (it updates to the last match during the split loop).
https...
headius (Charles Nutter)
08:49 PM Bug #12689: Thread isolation of $~ and $_
Waking this up a bit...
The original issue that prompted this bug report has now been FIXED in JRuby 9.2.17.0 by making String#split never read backref from the frame-local storage:
https://github.com/jruby/jruby/pull/6644
Furth...
headius (Charles Nutter)
07:25 PM Bug #17772 (Rejected): Performance issue with NameError message in context with large instance variables (not caused by did_you_mean)
The following script takes about 2 seconds (tested on 2.6.6 and 2.7.2) to get from 'rescue' to 'ensure' on my machine, when executed as `ruby --disable-did_you_mean script.rb`. The time is taken by getting the `e.message`.
```
class ...
Confusion (Ivo Wever)
07:06 PM Feature #17771: String#start_with? should not construct MatchData or set $~
An alternative to using `str =~ /^pat/` for a `start_with?` that provides a MatchData would be to add a `start_with` that is not a boolean query method. headius (Charles Nutter)
07:04 PM Feature #17771: String#start_with? should not construct MatchData or set $~
It really feels like an unintended side-effect of the method. If you write this method and accept a variable then depending on the type of that variable there is either some MatchData (MD) as a side-effect or there isn't. This is incon... enebo (Thomas Enebo)
06:25 PM Feature #17771: String#start_with? should not construct MatchData or set $~
I see this behavior was explicitly blessed by matz in #13712 but I still believe this is not the best choice.
Around the same time as that discussion, another boolean query method `match?` was added that explicitly does *not* set the ...
headius (Charles Nutter)
06:13 PM Feature #17771: String#start_with? should not construct MatchData or set $~
I will also point out that this method, like many others, will *not* always set $~. If you pass a string, it remains whatever it was before:
```
$ rvm ruby-3.0 do ruby -e '"foo".start_with?("foo"); p $~'
nil
```
Avoiding the use...
headius (Charles Nutter)
06:08 PM Feature #17771 (Open): String#start_with? should not construct MatchData or set $~
I am working on making $~ more thread-safe in JRuby and came across this unexpected behavior:
```ruby
$ rvm ruby-3.0 do ruby -e '"foo".start_with?(/foo/); p $~'
#<MatchData "foo">
```
The `start_with?` method was added 11 years ...
headius (Charles Nutter)
05:10 PM Revision c080bb22 (git): [Doc] Update to FrozenError from RuntimeError in Object#freeze
kachick (Kenichi Kamiya)
04:57 PM Revision 1ac68bba (git): [ruby/irb] SIGINT should raise Interrupt after IRB session
https://github.com/ruby/irb/commit/5832cfe75b ko1 (Koichi Sasada)
04:48 PM Revision 8e636bd0 (git): * 2021-04-02 [ci skip]
git[bot]
04:47 PM Revision ccb0b7ab (git): [ruby/irb] Suppress verbose messages in the parallel test
`:VERBOSE` flag needs to be set prior to `IRB::Irb.new`.
https://github.com/ruby/irb/commit/78604682d9
nobu (Nobuyoshi Nakada)
02:21 PM Feature #17768: Proposal: Downward assignments
Bidirectional assignments should be implemented to make swapping values:
```
var1, var2 = var2, var1
```
much shorter:
```
var1
vv^^
var2
```
Nakilon (Victor Maslov)
01:27 PM Feature #17768: Proposal: Downward assignments
What an amazing, beautiful, and revolutionary idea!
But what about using an overbar (U+203E) instead of circumflex? It's not that hard to type and it brings extra clarity and visual pleasantness to the code, while eliminating any possib...
Dan0042 (Daniel DeLorme)
12:55 PM Feature #17768: Proposal: Downward assignments
plot twist by **mame** similar to last year:
- It's actually not a joke. :)
plot twist by **matz** this year:
- He actually WILL approve joke suggestions this year.
shevegen (Robert A. Heiler)
01:23 AM Feature #17768: Proposal: Downward assignments
marcandre (Marc-Andre Lafortune) wrote in #note-4:
> (It took me a while to realize the date in Japan :-) )
I waited until 00:00 UTC 🕛👍
mame (Yusuke Endoh)
01:13 AM Feature #17768: Proposal: Downward assignments
I'd like a shorthand for cases where we don't really need a variable...
```ruby
while gets != nil
p ^^^^
end
```
(It took me a while to realize the date in Japan :-) )
marcandre (Marc-Andre Lafortune)
01:11 AM Feature #17768: Proposal: Downward assignments
Is this intentional?
```
$ cat test.rb
p(2 * 3 * 7)
^^^^^var1
^^^var2
p var1
p var2
$ ./miniruby test.rb
test.rb:3: syntax error, unexpected '^', expecting end-of-input
^^^var2
```
mrkn (Kenta Murata)
12:53 AM Feature #17768: Proposal: Downward assignments
I think this syntax is not `irb` friendly. znz (Kazuhiro NISHIYAMA)
12:21 AM Feature #17768: Proposal: Downward assignments
super convenient!!1 ko1 (Koichi Sasada)
12:10 AM Feature #17768 (Rejected): Proposal: Downward assignments
Rightward assignments have been introduced since 3.0.
To be honest, I'm not a big fan of the syntax because it does not add a new dimension to Ruby.
Why don't we bring Ruby to the next dimension?
## Proposal
I propose "downward...
mame (Yusuke Endoh)
02:13 PM Bug #17770: Assets precompilation aborts with Segmentation fault
Are you able to reproduce locally in a clean Rails app with administrate installed?
The backtrace looks like it could be a bug in sassc.
peterzhu2118 (Peter Zhu)
08:49 AM Bug #17770 (Third Party's Issue): Assets precompilation aborts with Segmentation fault
ruby 2.6.1p33 (2019-01-30 revision 66950) [x86_64-linux]
What changed? I updated a gem version, administrate 0.14.0 to 0.15.0
when deploying to server the following error is constantly appearing.
Note: when reverting to versi...
dvodvodvo (Jerome Camus)
01:54 PM Revision 9513fcd5 (git): Suppress a warning
Loop variables of `list_for_each` need to be initialized. nobu (Nobuyoshi Nakada)
10:51 AM Revision 68a8f611 (git): coroutine: Darwin on ARM64 needs alignment of 2^2
David CARLIER
09:58 AM Feature #17762: A simple way to trace object allocation
> I guess if we do have a method on Object/Kernel it could simply be Object#source_location for consistency with [...] Method/UnboundMethod
Hum, That would actually be a problem. Because I might want to know where a `Method` on `Unbou...
byroot (Jean Boussier)
03:25 AM Feature #17769: Proposal: numeric coefficient syntax
Replace the patch with refactoring. mrkn (Kenta Murata)
03:14 AM Feature #17769: Proposal: numeric coefficient syntax
I replaced the attached patch with changes to accept not only `2x` but also `2(x + 1)`. mrkn (Kenta Murata)
02:13 AM Feature #17769: Proposal: numeric coefficient syntax
`2i` is an imaginary number literal so it is `Complex(0, 2)`. mrkn (Kenta Murata)
02:08 AM Feature #17769: Proposal: numeric coefficient syntax
```
i = 10
p 2i # => 20 or Complex(0,2)?
```
Matz.
matz (Yukihiro Matsumoto)
01:23 AM Feature #17769 (Rejected): Proposal: numeric coefficient syntax
When we write a mathematical equation, we often omit a multiplication operator between a coefficient and a variable like `2x`.
I guess this convention can be useful in computer programming. Practically, Julia employs this notation:
...
mrkn (Kenta Murata)
03:00 AM Revision e675a789 (git): * 2021-04-01 [ci skip]
git[bot]
03:00 AM Revision a5567350 (git): Refactored sub-seconds normalizations
* separated argument to `timespec2timew` from `timespec` to seconds and
nano-seconds.
* unified nano-seconds and micro-seconds normalizations.
nobu (Nobuyoshi Nakada)

03/31/2021

10:13 PM Bug #17765: Segmentation fault when calling String#gsub
> But without success so far.
I wouldn't be surprised if the bug wasn't in `gsub` itself, but in some C extension that would generate a faulty string on which `gsub` would trip. I see you have `thrift` loaded for instance. IIRC that's...
byroot (Jean Boussier)
01:10 PM Bug #17765: Segmentation fault when calling String#gsub
It is difficult to identify the problem because the log lacks C level backtrace information maybe due to musl.
Are you using Alpine Linux? If so could you try Debian with glibc?
mame (Yusuke Endoh)
11:57 AM Bug #17765 (Feedback): Segmentation fault when calling String#gsub
We recently had a ruby segfault occuring while invoking `String#gsub`.
The line in the code looks like this:
``` ruby
def sanitize_for_prometheus(string_or_symbol)
reg = /[^a-zA-Z_0-9]/
string_or_symbol.to_s.downcase.gsub(r...
lenwood (Paul Martensen)
09:56 PM Bug #17766 (Rejected): Net::HTTP verify_callback is called three times when opening a connection
jeremyevans0 (Jeremy Evans)
09:50 PM Bug #17766: Net::HTTP verify_callback is called three times when opening a connection
This is being called once for each cert in the chain, so it's an expected behavior, and this bug can be closed.
```
ruby -e 'require "net/http"; Net::HTTP.start("www.ebay.com", 443, nil, nil, nil, nil, use_ssl: true, verify_callback: ->...
jecain (Jim Cain)
05:24 PM Bug #17766 (Rejected): Net::HTTP verify_callback is called three times when opening a connection
I've noticed that verify_callback is called three times when opening a connection. Here is an example: (Change "localhost" to whatever host can receive an HTTPS connection.)
```
ruby -e 'require "net/http"; Net::HTTP.start("localhost...
jecain (Jim Cain)
07:42 PM Bug #17767 (Closed): `Cloned ENV` inconsistently returns `ENV` or `self`
GH-PR: https://github.com/ruby/ruby/pull/4344
Is this an expected behavior? 😅
```console
$ ruby -v
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]
```
```ruby
cloned_env = ENV.clone
p ENV.each_key{}.equal...
kachick (Kenichi Kamiya)
06:42 PM Feature #17762: A simple way to trace object allocation
byroot (Jean Boussier) wrote in #note-11:
> Even though a the name is very slightly weird when put in context with `Method#source_location`, as `source` have a different meaning in both of these. But `allocation_location` would be even w...
Eregon (Benoit Daloze)
07:05 AM Feature #17762: A simple way to trace object allocation
> How about ObjectSpace.allocation_source(obj)?
That would be fine by me, it is a much more reasonable than the `[ObjectSpace.allocation_sourcefile(obj), ObjectSpace.allocation_sourceline(obj)]` I write almost daily.
Even though a ...
byroot (Jean Boussier)
02:04 AM Feature #17762: A simple way to trace object allocation
Eregon (Benoit Daloze) wrote in #note-5:
> tenderlovemaking (Aaron Patterson) wrote in #note-4:
> ...
Agreed. I'm worried I may commit it inadvertently after debugging is finished.
But I'm unsure if the message is helpful to prevent t...
mame (Yusuke Endoh)
02:02 AM Feature #17762: A simple way to trace object allocation
tenderlovemaking (Aaron Patterson) wrote in #note-4:
> I submitted #10932, so I would definitely like a feature like this. 😆
Oops, sorry!
Good news: I talked with @ko1 in person, and now he is positive (or, at least not negative) to...
mame (Yusuke Endoh)
01:59 AM Feature #17762: A simple way to trace object allocation
Eregon (Benoit Daloze) wrote in #note-3:
> `require "objspace/trace"` automatically starting tracing seems dangerous, there is a pretty big performance penalty to enable it.
> ...
`require "objspace/start_tracing"` sounds good to me.
>...
mame (Yusuke Endoh)
01:52 AM Feature #17762: A simple way to trace object allocation
Thank you all for the comments.
byroot (Jean Boussier) wrote in #note-2:
> > p obj #=> #<Object:0x...> @ (file.rb):(lineno)
> ...
I think this is also one of the reasonable options.
In fact, my original idea was `Object#allocatio...
mame (Yusuke Endoh)
06:34 PM Feature #17363: Timeouts
Timeout.wake sounds a bit like Java's `Thread#interrupt()`, correct?
So it would interrupt blocking calls (`File.read`/`Queue#pop`/`rb_thread_call_without_gvl`/`sleep`/`Mutex#lock`/etc) but wouldn't interrupt not-blocking Ruby code like...
Eregon (Benoit Daloze)
01:14 PM Revision 2a02b61f (git): Use EnvUtil.under_gc_stress
nobu (Nobuyoshi Nakada)
10:48 AM Misc #17720: Cirrus CI to check non-x86_64 architecture cases by own machines
> Yes, I means not only the Cirrus CI.
OK.
By the way, related to this topic, I found the following ticket asking the expanded platform support of GitHub Actions. The platforms are such as PowerPC, IBM Mainframe, Solaris, old Red H...
jaruga (Jun Aruga)
10:18 AM Revision 1fac99af (git): skip marking for uninitialized imemo_env.
RUBY_INTERNAL_EVENT_NEWOBJ can expose uninitialized imemo_env
objects and marking it will cause critical error. This patch
skips marking on uninitialized imemo_env.
See: http://rubyci.s3.amazonaws.com/centos7/ruby-master/log/20210329T18...
ko1 (Koichi Sasada)
10:15 AM Feature #17763: Implement cache for cvars
tenderlovemaking (Aaron Patterson) wrote in #note-6:
> Also in this case, it makes me feel weird to change the implementation of Rails when we can just make Ruby perform better. Changing Rails to suit Ruby seems like the tail wagging t...
Eregon (Benoit Daloze)
09:05 AM Revision 8b2f2a70 (git): [ruby/openssl] Use #ifdef consistently for HAVE_RB_EXT_RACTOR_SAFE
We previously used a mix of both `#if` and `#ifdef`, but the latter is
more reliable because it will still work if the macro is undefined.
https://github.com/ruby/openssl/commit/e4a622e67e
Tom Stuart
09:05 AM Revision 5ab26252 (git): [ruby/openssl] Fix OpenSSL::Engine build on Debian
On Debian 9 (“stretch”) the `OPENSSL_NO_STATIC_ENGINE` macro is not
defined, which causes all the `#if HAVE_ENGINE_LOAD_…` directives to
fail with `error: 'HAVE_ENGINE_LOAD_…' is not defined, evaluates to 0
[-Werror,-Wundef]` while build...
Tom Stuart
09:05 AM Revision e2bf3659 (git): [ruby/openssl] pkcs7: keep private key when duplicating PKCS7_SIGNER_INFO
ASN1_dup() will not copy the 'pkey' field of a PKCS7_SIGNER_INFO object
by design; it is a temporary field kept until the PKCS7 structure is
finalized. Let's bump reference counter of the pkey in the original
object and use it in the new...
rhenium (Kazuki Yamaguchi)
06:18 AM Revision 66d2fc79 (git): Enclose the code that was accidentally a link in "tt"
aycabta (aycabta .)
03:13 AM Bug #17764: ブロック付きメソッドにおけるproc(または Proc.new)の参照がArgumentErrorを吐く問題
ご教示大変ありがとうございます。
希望した動作ができました。
恥ずかしながら、ブロック引数の指定がない場合に&blkがnilとなる挙動を把握できていませんでした。
さらに一時遅いと言われたことのある&引数は従来のprocよりも高速なのですね。勉強いたします。
諸兄のご親切に重ねて御礼申し上げます。
貴重なお時間をありがとうございました。
osyo (manga osyo) wrote in #note-5:
> やりたいこととしてはこういうことでしょうか?
> ....
firelzrd (Masahito Suzuki)
03:05 AM Bug #17764: ブロック付きメソッドにおけるproc(または Proc.new)の参照がArgumentErrorを吐く問題
「メソッド呼び出し時のブロック引数は省略可能にしておきたい」という要求の正確な意味がわからなかったのですが、これが「引数リストに&blk変数を指定したくない」というものだとすれば、それは3.0からできなくなりました。これまではprocメソッドを引数なしで呼び出す方法でメソッドに渡されたブロックをProcとして取り出せていましたが、暗黙のコンテキスト参照が入りますし、読解の点からも望ましくないと考えての変更です。「&blk引数」を使ってください。それに、たぶんこっちのほう... matz (Yukihiro Matsumoto)
03:04 AM Bug #17764: ブロック付きメソッドにおけるproc(または Proc.new)の参照がArgumentErrorを吐く問題
firelzrd (Masahito Suzuki) wrote in #note-4:
> ご返答ありがとうございます。
> ...
やりたいこととしてはこういうことでしょうか?
```ruby
def foo(&block)
# ブロック引数がない場合は block は nil になる
puts (block ? block : proc{"ブロックなし"}).call
end
foo #ブロックなし => "ブロックなし"
foo...
osyo (manga osyo)
02:57 AM Bug #17764: ブロック付きメソッドにおけるproc(または Proc.new)の参照がArgumentErrorを吐く問題
ご返答ありがとうございます。
ご主旨、理解いたしました。ご教示ありがとうございます。お騒がせいたしました。
つきましては、差し支えなければ、
①ブロック引数として渡されたprocをメソッド内で変数として参照したい
②メソッド呼び出し時のブロック引数は省略可能にしておきたい
というニーズが両立する場合にどのようにすればよいか、ヒントをいただければ幸いです。
①を実現するだけならば&の付いたブロック引数を取ればよさそうですが…
あるメソッドにブロッ...
firelzrd (Masahito Suzuki)
02:35 AM Bug #17764 (Closed): ブロック付きメソッドにおけるproc(または Proc.new)の参照がArgumentErrorを吐く問題
ブロック付きメソッドの中でブロックなし `proc` したとき、エラーになるようになった、というのが、3.0 での変更点です。
```ruby
def foo
proc
end
foo{} #=> `proc': tried to create Proc object without a block (ArgumentError)
```
ko1 (Koichi Sasada)
02:30 AM Bug #17764: ブロック付きメソッドにおけるproc(または Proc.new)の参照がArgumentErrorを吐く問題
ご返答ありがとうございます。
本件は「ブロックを指定しない proc」についてではなく「ブロックを指定した proc」がどうもバグっているのではないかと思い報告させていただきました。
ブロック付きでメソッドをコールしたとき、メソッド内ではblock_given?の値がtrueとなり、proc (またはProc.new)で渡されたブロックを参照可能なはずですが、
サンプルプログラムの挙動でもお分かりいただけるように、block_given?==trueの時のpr...
firelzrd (Masahito Suzuki)
12:56 AM Bug #17764: ブロック付きメソッドにおけるproc(または Proc.new)の参照がArgumentErrorを吐く問題
Ruby 3.0 からはブロック引数がない `Proc.new` / `proc` は `ArgumentError` になるようになりました。
> ブロックを指定しない lambda は Ruby 2.6 までは警告メッセージ「warning: tried to create Proc object without a block」が出力され、Ruby 2.7 では ArgumentError (tried to create Proc object witho...
osyo (manga osyo)
12:41 AM Bug #17764 (Closed): ブロック付きメソッドにおけるproc(または Proc.new)の参照がArgumentErrorを吐く問題

ブロック付きメソッドにおけるproc(または Proc.new)の参照がArgumentErrorを吐く問題
Ruby 3.0.0 linux x86-64およびWindows上のmingw-x86-64バイナリにて発生し、2.7.2-1ではいずれも発生しないことを確認済み。
また、2021/3/31現在、TryRubyサイト( https://try.ruby-lang.org/ ) の上でも発生することを確認済み。
```
def foo
pu...
firelzrd (Masahito Suzuki)
12:19 AM Feature #17472: HashWithIndifferentAccess like Hash extension
marcandre (Marc-Andre Lafortune) wrote in #note-21:
> duerst (Martin Dürst) wrote in #note-20:
> ...
Thanks for the pointer. I haven't fully understood that page, but it seems to me that in JS, the 'uniqueness' aspect is much more impo...
duerst (Martin Dürst)

03/30/2021

11:57 PM Feature #17763: Implement cache for cvars
duerst (Martin Dürst) wrote in #note-5:
> What would it take e.g. to switch Rails logger to something else?
> ...
Class variables have different semantics than class instance variables. It's possible to switch some things to use class...
tenderlovemaking (Aaron Patterson)
11:27 PM Feature #17763: Implement cache for cvars
Eregon (Benoit Daloze) wrote in #note-4:
> Eregon (Benoit Daloze) wrote in #note-2:
> ...
I'm not sure that "better optimize, because some important code keeps using this, but don't really optimize all the way, because it's no so pop...
duerst (Martin Dürst)
07:45 PM Feature #17763: Implement cache for cvars
Eregon (Benoit Daloze) wrote in #note-2:
> they are inherently less efficient than instance variables on modules.
@chrisseaton told me that it's not necessarily the case, and I think they can be exactly the same for a regular read (S...
Eregon (Benoit Daloze)
07:26 PM Feature #17763: Implement cache for cvars
Eregon (Benoit Daloze) wrote in #note-2:
> Nice work.
> ...
I think we probably could do that. Keeping a global counter just seemed like the easiest solution at the moment. Also, cvars seem very unpopular (compared with ivars) so I'm ...
tenderlovemaking (Aaron Patterson)
07:05 PM Feature #17763: Implement cache for cvars
Nice work.
I guess using a global serial here is the only way to handle overtaking without redoing the lookup every time like before.
I wonder, could the serial be global (not per module) but per name? (not asking to change anything,...
Eregon (Benoit Daloze)
06:24 PM Feature #17763: Implement cache for cvars
This is the missing benchmark I copy and pasted incorrectly.
Ruby master / Rails 6.1:

```
Warming up ———————————————————
logger 155.251k I/100ms
Calculating ——————————————————
...
eileencodes (Eileen Uchitelle)
05:57 PM Feature #17763 (Closed): Implement cache for cvars
# Introduce inline cache for class variable reads
@tenderlove and I would like to introduce an inline cache for class variable reads. We've attached a patch that introduces the cache. Class variable reads are popular in Rails applicat...
eileencodes (Eileen Uchitelle)
11:11 PM Feature #16295: Chainable aliases for String#-@ and String#+@
`+@` is rarely safe to use (only if you know what allocated it and that it was never captured in another variable) as it might mutate an argument inplace, if that object is not frozen.
In most cases, people actually want to use `.dup` a...
Eregon (Benoit Daloze)
09:52 PM Feature #16295: Chainable aliases for String#-@ and String#+@
danh337 (Dan Higgins) wrote in #note-14:
> I believe this shows the semantics. It's the inverse of `.freeze`:
> ...
It's not the inverse of freeze, since that is not possible in Ruby. freeze always returns the receiver. thaw could no...
jeremyevans0 (Jeremy Evans)
09:31 PM Feature #16295: Chainable aliases for String#-@ and String#+@
I believe this shows the semantics. It's the inverse of `.freeze`:
`class String; def thaw; frozen? ? self.+@ : self; end; end`
danh337 (Dan H)
09:12 PM Feature #16295: Chainable aliases for String#-@ and String#+@
The `-@` and `+@` calls do work fine for chaining. But `.-@` has a nice equivalent, `.freeze`. Is it possible to give `.+@` a nice equivalent, like `.thaw`? This feels more Rubyistic.
Are newer Ruby MRIs going to have core methods ret...
danh337 (Dan H)
08:11 PM Feature #17762: A simple way to trace object allocation
tenderlovemaking (Aaron Patterson) wrote in #note-4:
> I don't think it's needed. If you require the file, you know it's enabled.
For the person who just wrote it it's clear enough.
But what if that accidentally gets committed and ...
Eregon (Benoit Daloze)
07:43 PM Feature #17762: A simple way to trace object allocation
I submitted #10932, so I would definitely like a feature like this. 😆
> Is the message objspace/trace is enabled needed or not?
I don't think it's needed. If you require the file, you know it's enabled.
> ...
This is fine. Nobody wi...
tenderlovemaking (Aaron Patterson)
07:16 PM Feature #17762: A simple way to trace object allocation
`require "objspace/trace"` automatically starting tracing seems dangerous, there is a pretty big performance penalty to enable it.
So I think the message on stderr is needed, and maybe it should be more explicit like `require "objspace/s...
Eregon (Benoit Daloze)
03:59 PM Feature #17762: A simple way to trace object allocation
> Whenever I want to use them, I have to google, copy and paste the names.
Seconded. I use this feature almost daily, and somehow I also have to reach to the doc every time.
> ...
That makes sense to me.
> p obj #=> #<Object:0x....
byroot (Jean Boussier)
03:45 PM Feature #17762: A simple way to trace object allocation
I think this is a good suggestion.
Please correct me if my assumptions are wrong, but if I understood the general gist of it correctly
then the main point here is that, rather than focusing on specific names, such as
ObjectSpace.tra...
shevegen (Robert A. Heiler)
02:57 PM Feature #17762 (Closed): A simple way to trace object allocation
How about having a short hand to `ObjectSpace.trace_object_allocations_start`, `ObjectSpace.allocation_sourcefile` and `ObjectSpace.allocation_sourceline`?
They are a very powerful tool for debugging and code-reading which allows us t...
mame (Yusuke Endoh)
07:18 PM Bug #17527 (Closed): rb_io_wait_readable/writable with scheduler don't check errno
ioquatix (Samuel Williams)
08:15 AM Bug #17527: rb_io_wait_readable/writable with scheduler don't check errno
I would advise we should back port this to 3.0.1 if possible. The original patch attached to this issue is sufficient. ioquatix (Samuel Williams)
07:38 AM Bug #17527: rb_io_wait_readable/writable with scheduler don't check errno
I added a failing spec https://github.com/ruby/ruby/pull/4338/commits/e111d99ae1b58e1ffe73c167c039b2fc0728cb08 which passes with the proposed fix. ioquatix (Samuel Williams)
07:02 AM Bug #17527: rb_io_wait_readable/writable with scheduler don't check errno
Okay, I confirmed the fix is required for `async-io` to use the native IO methods.
```
samuel@Fukurou ~/D/s/async-io (master) [1]> chruby ruby-3
samuel@Fukurou ~/D/s/async-io (master)> bundle exec rspec ./spec/async/io/stream_spec.r...
ioquatix (Samuel Williams)
06:12 AM Bug #17527: rb_io_wait_readable/writable with scheduler don't check errno
PR: https://github.com/ruby/ruby/pull/4338 ioquatix (Samuel Williams)
05:51 AM Bug #17527: rb_io_wait_readable/writable with scheduler don't check errno
I think I ran into this bug on the write code path. I'm just going to confirm it. ioquatix (Samuel Williams)
03:09 PM Revision d977849e (git): * 2021-03-31 [ci skip]
git[bot]
02:41 PM Revision 94d56407 (git): Text files should end with a newline
nobu (Nobuyoshi Nakada)
02:29 PM Bug #17761 (Closed): Install location of header files in extension libraries
Applied in changeset commit:git|5cdf99f64e344b8e4638824d55f5caf33be682ca.
----------
mkmf: fixed install directories of header files in extension libraries [Bug #17761]
When installing an extension library which provides a header, that...
nobu (Nobuyoshi Nakada)
02:10 PM Bug #17761 (Closed): Install location of header files in extension libraries
When installing an extension library which provides a header, that header should be installed under site_ruby (or vendor_ruby when "--vendor" option was given to extconf.rb).
However, currently this file is about to be installed in the ...
nobu (Nobuyoshi Nakada)
02:28 PM Revision 5cdf99f6 (git): mkmf: fixed install directories of header files in extension libraries [Bug #17761]
When installing an extension library which provides a header, that
header should be installed under site_ruby (or vendor_ruby when
"--vendor" option was given to extconf.rb). However, currently
this file is about to be installed in the ...
nobu (Nobuyoshi Nakada)
02:20 PM Feature #17760 (Third Party's Issue): Where we should install a header file when `gem install --user`?
This is because rubygems doesn't manage header files installed from gems, since no gems had installed headers until digest has been gemified.
Now rubygems needs to support such gems.
nobu (Nobuyoshi Nakada)
12:51 AM Feature #17760: Where we should install a header file when `gem install --user`?
The permission error was reported at https://github.com/ruby/digest/issues/14. mrkn (Kenta Murata)
12:50 AM Feature #17760 (Third Party's Issue): Where we should install a header file when `gem install --user`?
As `digest` have been made a default gem at Ruby 3.0, it can be installed by `gem install` command.
When we install `digest`, `digest.h` is installed at the same directory as `ruby.h`. But when we use `gem install --user` for instal...
mrkn (Kenta Murata)
11:58 AM Revision 9713acd7 (git): Fix `coroutine_type` variable name
znz (Kazuhiro NISHIYAMA)
10:16 AM Revision a9c5c2d6 (git): Check errno before invoking scheduler in `rb_io_wait_readable/writable`.
See <https://bugs.ruby-lang.org/issues/17527> for more details. Samuel Williams
10:16 AM Revision 611e7110 (git): Test incorrect behaviour of `rb_io_wait_readable/writable`.
Samuel Williams
06:24 AM Feature #17546 (Closed): Native coroutine implementation for riscv64 Linux
It looks like it didn't break anything, so I've merged it, but can you please test it and report back? ioquatix (Samuel Williams)
05:48 AM Feature #17546: Native coroutine implementation for riscv64 Linux
It will be merged, https://github.com/ruby/ruby/pull/4337 but it needs more testing. Do we have any CI? ioquatix (Samuel Williams)
06:23 AM Revision b507f65d (git): Support for native riscv64 coroutines.
Samuel Williams
05:38 AM Revision 3d32c217 (git): Disable public interface for now.
Samuel Williams
05:38 AM Revision 92449e0e (git): Fix handling of timeout accessing scheduler outside of non-blocking context.
Samuel Williams
05:38 AM Revision af1c5875 (git): Improve timeout tests.
Samuel Williams
05:38 AM Revision 511acba4 (git): Update method name and add documentation.
Samuel Williams
05:38 AM Revision 09c865d5 (git): Fix native implementation.
# Conflicts:
# scheduler.c
Samuel Williams
05:38 AM Revision 67f60ebb (git): Fixed a compilation error
nobu (Nobuyoshi Nakada)
05:38 AM Revision c05dd7dc (git): Prefer `rb_check_funcall`.
Samuel Williams
05:38 AM Revision 9b9bbaec (git): Update lib/timeout.rb
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> Samuel Williams
05:38 AM Revision 4c53dc97 (git): Add hook for `Timeout.timeout`.
Samuel Williams
05:38 AM Feature #17470 (Closed): Introduce non-blocking `Timeout.timeout`
Implemented in <https://github.com/ruby/ruby/pull/4173>. ioquatix (Samuel Williams)
05:28 AM Revision 93753d7e (git): * 2021-03-30 [ci skip]
git[bot]
05:27 AM Revision d65d6611 (git): [ruby/irb] Prevent the completion from crashing if rdoc is missing
There are cases where ruby is installed without rdoc and e.g.
lib/irb/cmd/help.rb also handles the LoadError
Here is how to replicate the issue:
```
$ docker run -it alpine:3.13.3 sh
/ # apk add ruby ruby-irb ruby-io-console
/ # irb
...
bliof (Aleksandar Ivanov)
03:29 AM Bug #17737: `Array#permutation` does not immediately check the arity when no block is given
I am not opposed to changes, but I don't believe this actually matters; I can not think of a use-case.
A similar question could be asked of `[].permutation(:oops)`. Should it raise immediately? Asked another way, if the argument respo...
marcandre (Marc-Andre Lafortune)
12:15 AM Bug #17573: Crashes in profiling tools when signals arrive in non-Ruby threads
> Ah, OK. This issue doesn't expose on recent Linux system.
I can somewhat reliably repro by running `ruby --jit repro.rb` with the following:
```ruby
# repro.rb
require "stackprof"
StackProf.run(interval: 100) do
1000.ti...
alanwu (Alan Wu)

03/29/2021

11:29 PM Bug #17742 (Closed): Random.rand gets wrong after using Ractor and requiring benchmark
jeremyevans0 (Jeremy Evans)
11:10 PM Bug #17739: Array#sort! changes the order even if the receiver raises FrozenError in given block
I think this is a bug, but it's not that `Array#sort!` should keep the initial order of the receiver, it's that it should keep the order at the point `freeze` is called, and it does not:
```ruby
array = [1, 2, 3, 4, 5]
begin
arra...
jeremyevans0 (Jeremy Evans)
10:36 PM Bug #17738 (Rejected): Ruby can still freeze ENV
jeremyevans0 (Jeremy Evans)
10:15 PM Bug #17737: `Array#permutation` does not immediately check the arity when no block is given
If this is a bug, it doesn't just affect `Array#permutation`, but many `Enumerable` methods:
```ruby
[].each_entry(2)
# => #<Enumerator: []:each_entry(2)>
[].each_entry(2).to_a
# ArgumentError (wrong number of arguments (given 1, ...
jeremyevans0 (Jeremy Evans)
06:28 PM Bug #17728: [BUG] Segmentation fault at 0x0000000000000000
> I'll start working with the master branch version this week
Note that I was suggesting `ruby_3_0`: https://github.com/ruby/ruby/tree/ruby_3_0 which is the 3.0 "stable" branch (what will someday become 3.0.1).
`master` is what wil...
byroot (Jean Boussier)
02:16 PM Bug #17728: [BUG] Segmentation fault at 0x0000000000000000
byroot (Jean Boussier) wrote in #note-4:
> > Attached is a full session dump,
> ...
Thanks Jean, I'll start working with the master branch version this week and see if the issue persists.
jgelo (Jon Gelo)
02:45 PM Bug #13708 (Closed): catastrophic slow compilation of defined-defined sequence has no chance to ^C
Applied in changeset commit:git|7b3c5ab8a5825a2b960e639d257f0c8a69c4186c.
----------
Make defined? cache the results of method calls
Previously, defined? could result in many more method calls than
the code it was checking. `defined? a...
jeremyevans (Jeremy Evans)
02:45 PM Bug #17649 (Closed): `defined?` invokes method once for each syntactic element around it
Applied in changeset commit:git|7b3c5ab8a5825a2b960e639d257f0c8a69c4186c.
----------
Make defined? cache the results of method calls
Previously, defined? could result in many more method calls than
the code it was checking. `defined? a...
jeremyevans (Jeremy Evans)
02:45 PM Revision 62e66aed (git): Add more tests for defined? with method calls
jeremyevans (Jeremy Evans)
02:45 PM Revision 7b3c5ab8 (git): Make defined? cache the results of method calls
Previously, defined? could result in many more method calls than
the code it was checking. `defined? a.b.c.d.e.f` generated 15 calls,
with `a` called 5 times, `b` called 4 times, etc.. This was due to
the fact that defined works in a re...
jeremyevans (Jeremy Evans)
10:57 AM Bug #17759: Correct `ioctl_req_t` for musl
> Would you commit it by yourself?
+1
mame (Yusuke Endoh)
10:44 AM Bug #17759: Correct `ioctl_req_t` for musl
Seems more concise.
Would you commit it by yourself?
nobu (Nobuyoshi Nakada)
09:05 AM Bug #17759 (Closed): Correct `ioctl_req_t` for musl
The definition of `ioctl(2)` in musl is `int ioctl (int, int, ...);`, and this makes `io.c` fail to build on 64-bit musl environments with Clang/LLVM due to `shorten-64-to-32` error.
A patch is attached for a workaround. It is expecte...
xtkoba (Tee KOBAYASHI)
10:42 AM Feature #11523 (Closed): optparse short options will match complete options
Applied in changeset commit:git|eca8ffaa0b446db0a1cacc82a2e73155f6fd3fce.
----------
[ruby/optparse] Add OptionParser#require_exact accessor
This allows you to disable allowing abbreviations of long options
and using short options for ...
jeremyevans (Jeremy Evans)
10:37 AM Revision 190a57b1 (git): [ruby/optparse] bump up to 0.1.1
https://github.com/ruby/optparse/commit/2fe984a603 nobu (Nobuyoshi Nakada)
10:37 AM Revision e8317d90 (git): [ruby/optparse] Fixed error message of unparsed non-option
Close https://github.com/ruby/optparse/issues/3
https://github.com/ruby/optparse/commit/94c5cf4032
nobu (Nobuyoshi Nakada)
09:24 AM Revision 2bbae0e9 (git): [ruby/optparse] Completion scripts themselves are not executable
https://github.com/ruby/optparse/commit/65d8aff935 nobu (Nobuyoshi Nakada)
09:24 AM Revision e97f21af (git): [ruby/optparse] Exclude unnecessary files from the package
https://github.com/ruby/optparse/commit/dfd9380231 nobu (Nobuyoshi Nakada)
06:55 AM Revision 7846f320 (git): [ruby/optparse] Change *opts to *params, to avoid confusion
https://github.com/ruby/optparse/commit/f5f5e202dd burdettelamar (Burdette Lamar)
06:55 AM Revision eca8ffaa (git): [ruby/optparse] Add OptionParser#require_exact accessor
This allows you to disable allowing abbreviations of long options
and using short options for long options.
Implements Ruby Feature #11523
https://github.com/ruby/optparse/commit/dfefb2d2e2
jeremyevans (Jeremy Evans)
06:55 AM Revision d474b19b (git): [ruby/optparse] Use ZDOTDIR env var to locate .zshrc
https://github.com/ruby/optparse/commit/c4977674bf Martin Rey
06:19 AM Revision d87b8ce6 (git): sync_default_gems.rb: ignore COPYING file [ci skip]
nobu (Nobuyoshi Nakada)
06:14 AM Revision f16b9e7f (git): sync_default_gems.rb: IO#puts prints a newline between each argument [ci skip]
nobu (Nobuyoshi Nakada)
04:49 AM Feature #17752: Enable -Wundef for C extensions in repository
As far as the effect of `-Wundef` do not leak to 3rd party extension libraries, yes I'm in favor of it. It sounds a bit too harsh for 3rd parties. shyouhei (Shyouhei Urabe)
02:35 AM Revision f46bbb2e (git): [DOC] Improve an example of Array#count comparison [ci skip]
nobu (Nobuyoshi Nakada)

03/28/2021

08:32 PM Revision 875c85a8 (git): fiber context update for Mac OS.
it is more about memory accounting sake. At allocation time,
we make clear we re possibly reusing regions marked as reusable.
Noted also calls might not necessarily succeed at first so we do
only when necessary.
David CARLIER
08:10 PM Revision a1938ec3 (git): [ruby/irb] Always add input method when calling Irb.new in tests
When passes input method as nil to Context.new through Irb.new,
ReidlineInputMethod.new is executed and the global internal state of Reline is
rewritten, therefore other tests are failed in the Ruby repository. This
commit changes to use...
aycabta (aycabta .)
07:33 PM Bug #17757: Hash#slice does not keep compare_by_identity on the results
I should have looked into this when I checked #16996.
Looks like we have behavior that is all over the place, and the same method sometimes returns a hash with different comparability depending if the receiver is empty or not...
``...
marcandre (Marc-Andre Lafortune)
12:25 PM Bug #17757 (Closed): Hash#slice does not keep compare_by_identity on the results
GH-PR: https://github.com/ruby/ruby/pull/4330
```console
$ ruby -v
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]
```
```ruby
str1 = +'str'
str2 = +'str'
hash = {a: :a, b: :b, c: :c}.compare_by_identity
hash...
kachick (Kenichi Kamiya)
06:39 PM Feature #17758: Provide Hash#count for performance improvement
Absolutely +1 marcandre (Marc-Andre Lafortune)
06:21 PM Feature #17758 (Open): Provide Hash#count for performance improvement
GH-PR: https://github.com/ruby/ruby/pull/4333
In my experience, many developers choice `size`, `length` and `count` as a matter of taste.
And Ruby already provide `Array#count` for performance improvement reason since https://github....
kachick (Kenichi Kamiya)
06:18 PM Revision 1cdecb43 (git): * 2021-03-29 [ci skip]
git[bot]
06:17 PM Revision 813c3333 (git): [Doc] Fix Array#count comparing strategy
kachick (Kenichi Kamiya)
05:29 PM Feature #17472: HashWithIndifferentAccess like Hash extension
> Actually, it does (since ES 6): https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol
I find it very unlikely any language will make symbols the default hash keys like Ruby did.
> ...
Why do you ...
joelb (Joel Blum)
03:17 AM Feature #17472: HashWithIndifferentAccess like Hash extension
duerst (Martin Dürst) wrote in #note-20:
> Javascript doesn't have symbols in the first place
Actually, it does (since ES 6): https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol
String are meant...
marcandre (Marc-Andre Lafortune)
01:56 AM Feature #17472: HashWithIndifferentAccess like Hash extension
joelb (Joel Blum) wrote in #note-19:
> > Use JSON.parse(data, symbolize_names: true)
> ...
Maybe we should change the default on JSON.parse? That would probably lead to too much backwards compatibility issues.
Maybe we should introd...
duerst (Martin Dürst)
04:12 PM Bug #17728: [BUG] Segmentation fault at 0x0000000000000000
> Attached is a full session dump,
Unfortunately your dump doesn't have C-level symbols.
But the crash in `:define_method` looks a lot like one of the few crash that have been fixed and backported already. I'd recommend trying to b...
byroot (Jean Boussier)
02:20 PM Bug #17728: [BUG] Segmentation fault at 0x0000000000000000
I've started testing a Rails 6.1.3 app with Ruby 3.0.0 and have run into this same issue multiple times in development mode. The issue is intermittent but seems to occur after changing a model and reloading a related view in the browser... jgelo (Jon Gelo)
02:42 PM Revision 989e22f3 (git): [ruby/io-console] bump up to 0.5.9
https://github.com/ruby/io-console/commit/302e86a28c
https://github.com/ruby/io-console/commit/0690862526
nobu (Nobuyoshi Nakada)
02:39 PM Revision f7faac13 (git): sync_default_gems.rb: remove un-committed files [ci skip]
As files non-existing in the repository cannot be checked out,
remove files to be ignored once, and re-check the status.
nobu (Nobuyoshi Nakada)
01:58 PM Revision 36bad6f1 (git): sync_default_gems.rb: search the last merge more strictly [ci skip]
As tag-only match, `[#{repo}]`, may find unexpected commit, e.g.,
5bfca88f760727240902a70d1df0cc516ff31a70 for io-console, match by
more exact URL pattern.
nobu (Nobuyoshi Nakada)
01:33 PM Feature #17753: Add Module#namespace
> Besides that, I do not see any reason to make them different in any way
Well, if `Module.nesting` because of its scope semantic can't be chained. `Module.nesting.nesting` would be problematic.
The proposed feature is very easily ...
byroot (Jean Boussier)
06:05 AM Feature #17753: Add Module#namespace
This feature is reminiscent of `Module.nesting`. The difference is that the former has dynamic scope and the latter lexical scope. Besides that, I do not see any reason to make them different in any way. What about returning an array of ... sawa (Tsuyoshi Sawada)
09:55 AM Bug #17735: `Hash#transform_keys!` drops non evaluated keys
I have confirmed that the issue is reproducible on 2.6/2.7 too. nagachika (Tomoyuki Chikanaga)
12:15 AM Bug #17735 (Closed): `Hash#transform_keys!` drops non evaluated keys
Applied in changeset commit:git|31e0382723bfb35cffe3ca485dd0577668cafa07.
----------
Keep non evaluated keys in `Hash#transform_keys!` [Bug #17735]
kachick (Kenichi Kamiya)
09:52 AM Revision 49c1c2dc (git): sync_default_gems.rb: escape filter command [ci skip]
nobu (Nobuyoshi Nakada)
05:10 AM Revision 603d7995 (git): sync_default_gems.rb: message when no commits [ci skip]
nobu (Nobuyoshi Nakada)
05:09 AM Revision 522d4cd3 (git): Force recycle intermediate collection in Hash#transform_keys! [Bug #17735]
* Force recycle intermediate hash
* Force recycle intermediate array too
https://github.com/ruby/ruby/pull/4329#issuecomment-808840718
kachick (Kenichi Kamiya)
05:06 AM Bug #17755 (Closed): Pathname#split makes segmentation fault when File.split returns non array value
Applied in changeset commit:git|9af57eeed61ad53c0a2a92a93a6a6e40704cd6ae.
----------
[ruby/pathname] Fix segfault of Pathname#split
Fix segmentation fault of Pathname#split when File.split returns
non array value [Bug #17755]
https://...
kachick (Kenichi Kamiya)
05:04 AM Revision 9af57eee (git): [ruby/pathname] Fix segfault of Pathname#split
Fix segmentation fault of Pathname#split when File.split returns
non array value [Bug #17755]
https://github.com/ruby/pathname/commit/e29b49e3b1
https://github.com/ruby/pathname/commit/1db7479a74
kachick (Kenichi Kamiya)
05:03 AM Revision 447e0954 (git): [ruby/pathname] Support Ruby 3.0
Update test/pathname/test_pathname.rb
https://github.com/ruby/pathname/commit/29645187e0
https://github.com/ruby/pathname/commit/78584864de
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
hsbt (Hiroshi SHIBATA)
05:02 AM Revision 38ea2306 (git): sync_default_gems.rb: preserve Co-Authored-By:
nobu (Nobuyoshi Nakada)
04:15 AM Misc #17751: Do these instructions (<<,+,[0..n]) modify the original string without creating copies?
xtkoba (Tee KOBAYASHI) wrote in #note-6:
> ```ruby
> ...
`IO#print` accepts multiple arguments, so this code can be `f.print data[:header], *data[:payload]`.
nobu (Nobuyoshi Nakada)
12:48 AM Revision fb6ebe55 (git): Hide an intermediate array
nobu (Nobuyoshi Nakada)
12:42 AM Revision 5e5fb72f (git): Clear an intermediate hash [Bug #17735]
nobu (Nobuyoshi Nakada)
12:14 AM Revision 31e03827 (git): Keep non evaluated keys in `Hash#transform_keys!` [Bug #17735]
kachick (Kenichi Kamiya)

03/27/2021

11:50 PM Revision e398a0e5 (git): Remove unneeded rb_ident_hash_new function declaration
S_H_ (Shun Hiraoka)
11:48 PM Bug #17754 (Closed): NoMethodError#to_s makes segmentation fault when Module#name returns non string value
Applied in changeset commit:git|0a544c0c35f7445d69402d7c53d825384c728017.
----------
Fix segmentation fault when `Module#name` returns non string value [Bug #17754]
* Add test for NoMethodError#to_s does not segfault
* Ensure no segfa...
kachick (Kenichi Kamiya)
02:14 PM Bug #17754 (Closed): NoMethodError#to_s makes segmentation fault when Module#name returns non string value
GH-PR: https://github.com/ruby/ruby/pull/4328
This code makes segmentation fault.
```console
$ ruby -v
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]
```
```ruby
pre = Module.new do
def name
:Foo
...
kachick (Kenichi Kamiya)
11:48 PM Revision cc15ae34 (git): * 2021-03-28 [ci skip]
git[bot]
11:47 PM Revision 0a544c0c (git): Fix segmentation fault when `Module#name` returns non string value [Bug #17754]
* Add test for NoMethodError#to_s does not segfault
* Ensure no segfault even if Module#name is overridden
kachick (Kenichi Kamiya)
09:51 PM Feature #17753: Add Module#namespace
Eregon (Benoit Daloze) wrote in #note-2:
> @sawa I'd say first assignment to a named constant wins, just like for Module#name.
Yes, this is what I would expect too (and implemented). 😄
> ...
Yes, this is a much better name. I've ...
tenderlovemaking (Aaron Patterson)
11:33 AM Feature #17753: Add Module#namespace
@sawa I'd say first assignment to a named constant wins, just like for Module#name.
I agree with the feature.
I'd suggest `Module#namespace` for the name though.
For example, I'd say the namespace of `Process::Status` is `Process`.
`sc...
Eregon (Benoit Daloze)
07:58 AM Feature #17753: Add Module#namespace
What would you expect if a module has multiple names?
```ruby
module E; end
E::F = A::B::C
```
Should `A::B::C.outer_scope` return `A::B` or `E`?
sawa (Tsuyoshi Sawada)
06:30 PM Bug #17756 (Closed): StringScanner#charpos makes segmentation fault when target.byteslice returns non string value
GH-PR: https://github.com/ruby/strscan/pull/20
This is a `strscan` issue.
I'm not sure the best way of how to handle bundled libraries tickets since they are Gemfied.
So I created this ticket just in case.
---
This code makes ...
kachick (Kenichi Kamiya)
02:27 PM Bug #17755 (Closed): Pathname#split makes segmentation fault when File.split returns non array value
GH-PR: https://github.com/ruby/pathname/pull/4
This looks a `pathname` issue, But It happened on `ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-darwin20]` too.
So I created this ticket just in case.
---
This code make...
kachick (Kenichi Kamiya)
12:48 PM Feature #17752: Enable -Wundef for C extensions in repository
Indeed, and that patch looks good to me. Eregon (Benoit Daloze)
12:25 PM Feature #17752: Enable -Wundef for C extensions in repository
> The value of the macro ultimately does not matter for all `HAVE_` macros.
There is a counterexample: `HAVE_BACKTRACE` in `vm_dump.c`, which is redefined as 0 when `BROKEN_BACKTRACE` is defined. I feel this to be an abuse of `HAVE_` ...
xtkoba (Tee KOBAYASHI)
11:43 AM Feature #17752: Enable -Wundef for C extensions in repository
The `#if UNDEFINED_IDENTIFIER` seems fairly rare (56 vs 637), so it also seems more consistent to always use `#ifdef` if the identifier might not always be defined.
One example is:
```c
#if HAVE_RB_EXT_RACTOR_SAFE
```
vs
```c
#i...
Eregon (Benoit Daloze)
03:25 AM Feature #17752: Enable -Wundef for C extensions in repository
I think it's just a matter of coding style to allow evaluating undefined identifiers, whether it is good or bad.
The example of `ext/nkf/nkf-utf8/nkf.h` seems intentional, just not bothering to write:
```c
#ifndef DEFAULT_NEWLINE
#...
xtkoba (Tee KOBAYASHI)
12:02 PM Revision 95d9fe95 (git): Update to ruby/spec@fd6eddd
Eregon (Benoit Daloze)
12:02 PM Revision 44736a6b (git): Update to ruby/mspec@d1adf59
Eregon (Benoit Daloze)
11:36 AM Misc #17751: Do these instructions (<<,+,[0..n]) modify the original string without creating copies?
I was looking for a FAQ on the site to see if it was allowed to open topics not related to bugs or improvements but I didn't find anything.
And about manipulating bits in a file I meant it literally, it's just as I said above, I thin...
stiuna (Juan Gregorio)
09:07 AM Misc #17751 (Closed): Do these instructions (<<,+,[0..n]) modify the original string without creating copies?
> When you say **"may take a long time"** does it apply even if **'str'** is 3GB and **'header'** is only 5bits?
Yes, it does. `String#prepend` need to memmove the content of `str`, which may take time proportional to the length of `str...
mame (Yusuke Endoh)
08:45 AM Misc #17751: Do these instructions (<<,+,[0..n]) modify the original string without creating copies?
@xtkoba
Hey thanks, your code gave me a great idea, with some modifications I can do what I needed. Very helpful.
*(Just in case the '_writeSince_' thing is still an open question, hopefully someone can help with that).*
stiuna (Juan Gregorio)
08:11 AM Misc #17751: Do these instructions (<<,+,[0..n]) modify the original string without creating copies?
There is no need to join when you write strings to a file:
```ruby
data = {:header => "header", :payload => ["foo", "bar"]}
File.open("datafile", "w") do |f|
f.print data[:header]
data[:payload].each do |s|
f.print s
end...
xtkoba (Tee KOBAYASHI)
07:45 AM Misc #17751: Do these instructions (<<,+,[0..n]) modify the original string without creating copies?
xtkoba (Tee KOBAYASHI) wrote in #note-3:
> I would not even concatenate any strings and would `push` them to an array, as if they were immutable (like in Go language for example).
But in the end that information will have to be writt...
stiuna (Juan Gregorio)
01:10 AM Misc #17751: Do these instructions (<<,+,[0..n]) modify the original string without creating copies?
> I would like to do something similar to (<<), which I understand does not create copies.
There is `String#prepend` method.
```
str.prepend(header)
```
> ...
`str[0..2] = ""` is an in-place operation.
Note, however, that t...
mame (Yusuke Endoh)
12:33 AM Misc #17751: Do these instructions (<<,+,[0..n]) modify the original string without creating copies?
I would not even concatenate any strings and would `push` them to an array, as if they were immutable (like in Go language for example).
If you really need to concatenate them and have to care about the speed and the memory efficiency...
xtkoba (Tee KOBAYASHI)
08:22 AM Revision 31ae931e (git): [Doc] Update regex engine to Onigumo in doc/extension.* [ci skip]
regex.c has been removed in 8e65234086a15f90585bc09cce82dbad2aa647d7 kachick (Kenichi Kamiya)
07:39 AM Revision 89fa5b13 (git): Add rb_exc_exception function
`rb_exc_raise` and `rb_fatal` func have similar code(in `eval.c`).
I think that better cut out and replace these code like `rb_exc_exception`
function.
S_H_ (Shun Hiraoka)
06:49 AM Feature #17472: HashWithIndifferentAccess like Hash extension
> Use JSON.parse(data, symbolize_names: true)
I know that. Yet the fact is these bugs happen again and again (not only to new Ruby devs, would you agree it's quite easy to forget to symbolize_keys or stringify or what have you). I don't...
joelb (Joel Blum)
01:03 AM Feature #17472: HashWithIndifferentAccess like Hash extension
joelb (Joel Blum) wrote in #note-17:
> [...] what happens is every time you do JSON.parse you will get stringified keys
Use `JSON.parse(data, symbolize_names: true)`
marcandre (Marc-Andre Lafortune)
12:31 AM Feature #17472: HashWithIndifferentAccess like Hash extension
> I think the critical use case for HashWithIndifferentAccess is params; where you want to be using symbol keys because it's cleaner syntax, but the keys are coming from untrusted input
We can agree the vast majority of Ruby devs are ...
joelb (Joel Blum)
03:55 AM Revision aceb8c0b (git): Fix Enumerable#tally with some arguments pattern [Feature #17744]
* Add test cases for Enumerable#tally with hash argument
* Add ruby/spec for Enumerable#tally with hash argument
* Fix Enumerable#tally does not update given frozen hash
* Add test cases for Enumerable#tally with hash convertible argu...
kachick (Kenichi Kamiya)
01:15 AM Revision 785c77d7 (git): * 2021-03-27 [ci skip]
git[bot]
01:15 AM Revision 8a89dd2a (git): No codesign in tests
nobu (Nobuyoshi Nakada)
 

Also available in: Atom