Activity
From 11/21/2020 to 11/27/2020
11/27/2020
-
08:32 PM Bug #17306: TestGCCompact#test_ast_compacts test failures
- vo.x (Vit Ondruch) wrote in #note-11:
> Testing with commit:git|6be9d18a4d and so far so good. Thank you.
Great! Thanks for reporting this :) -
06:20 PM Bug #17350: mongo-ruby-driver causes the segfault at program's exit
- Thank you for the report. I can reproduce and investigated the issue.
I think this is the known (but unfixed) issue #16288. When Ruby process ends, it terminates all threads, run all finalizers, and then destruct everything. However, ... -
10:19 AM Bug #17350 (Closed): mongo-ruby-driver causes the segfault at program's exit
- ## Overview
mongo-ruby-driver 2.11.0 has caused the segfault at program's exit when connecting a certain MongoDB cluster.
I also reported this issue to mongo-ruby-driver.
https://jira.mongodb.org/browse/RUBY-2453
This is the repr... -
03:14 PM Bug #17220: Rails Active Job integration test fails with Ruby 3.0.0 since 2038cc6cab6ceeffef3ec3a765c70ae684f829ed
- patch updated:
* call `rb_getaddrinfo_a_before_exec()` before `rb_thread_stop_timer_thread()`
* use `rb_protect()` instead of `rb_rescue` -
12:34 PM Bug #17220: Rails Active Job integration test fails with Ruby 3.0.0 since 2038cc6cab6ceeffef3ec3a765c70ae684f829ed
- `rb_rescue(call_getaddrinfo_a_before_exec, Qnil, NULL, Qnil)` should be `rb_protect`?
-
11:20 AM Bug #17220: Rails Active Job integration test fails with Ruby 3.0.0 since 2038cc6cab6ceeffef3ec3a765c70ae684f829ed
- patch updated
-
09:22 AM Bug #17220: Rails Active Job integration test fails with Ruby 3.0.0 since 2038cc6cab6ceeffef3ec3a765c70ae684f829ed
- I wrote a patch to fix this bug.
Before fork(), it cancels requests and waits for worker threads of getaddrinfo_a(3) to be finished.
@naruse -san, could you review this? -
03:05 PM Feature #17351: Deprecate Random::DEFAULT
- It seems pretty rare to need to supply a custom Random instance.
But in such a case, it would be easy to create an explicit one in e.g. the constructor:
```ruby
class Dice
def initialize(random = Random.new)
@random = random
... -
02:56 PM Feature #17351: Deprecate Random::DEFAULT
- I don't against to remove `Random::DEFAULT`, but need to care about current users.
```ruby
def roll rnd = nil
(rnd ? rnd.rand(6) : rand(6)) + 1
end
```
is one way, but I think some people can like previous definition. -
02:54 PM Feature #17351: Deprecate Random::DEFAULT
- > I don't think there is any use case for Random::DEFAULT, but happy to hear if there is and there is no trivial replacement.
As mentioned here: https://bugs.ruby-lang.org/issues/17322#note-7
there are several users.
For example, ... -
11:16 AM Feature #17351 (Closed): Deprecate Random::DEFAULT
- From https://bugs.ruby-lang.org/issues/17322#note-11
I think we should deprecate the `Random::DEFAULT` constant, it doesn't make sense anymore and it's longer than using Random class methods (Random.rand) or Kernel instance methods (#... -
02:47 PM Revision ddb1736b (git): Update to ruby/spec@c4170a3
-
01:55 PM Revision f02d2f82 (git): Update to ruby/spec@ac878ad
-
01:55 PM Revision f0bfa266 (git): Update to ruby/mspec@b58e665
-
01:38 PM Feature #17347: Enumerator::Chain of Enumerator::Lazy should be lazy
- Is it a duplicate? I can see it's similar, but I'm not entirely sure fixing #17216 will fix this. Willing to be wrong, though.
-
12:53 PM Feature #17307: A way to mark C extensions as thread-safe, Ractor-safe, or unsafe
- shyouhei (Shyouhei Urabe) wrote in #note-16:
> This is not what I know is a thread-safety. I understand what you need, but you should name the property differently than thread-safe, like for instance Truffle safe.
Could you explain ... -
12:38 PM Revision 039ba387 (git): Use opaque struct pointer than void
-
11:18 AM Misc #17346: DevelopersMeeting20201210Japan
- * [Feature #17351] Deprecate Random::DEFAULT (eregon)
* Is it OK?
* [Feature #16697] Hash.ruby2_keywords_hash?(value) should support any object (eregon)
* Yes/no? -
10:53 AM Revision 5d8fe126 (git): configure.ac: Check x86intrin.h only when the target CPU is x86
- The check output a warning on M1 Mac mini
http://rubyci.s3.amazonaws.com/osx1100arm/ruby-master/log/20201127T074507Z.log.html.gz
```
checking x86intrin.h usability... no
checking x86intrin.h presence... yes
configure: WARNING: x86intrin... -
10:39 AM Bug #17345: ripper: nothing raised when assigning to keyword variables
- Thanks for the quick fix, however `*_error` parser events except `parse_error` seem not to set an error message properly.
```
$ ruby -rripper -ve 'Ripper.lex("nil=1", raise_errors: true)'
ruby 3.0.0dev (2020-11-26T11:14:34Z master f... -
10:28 AM Feature #16604: Set default for Encoding.default_external to UTF-8 on Windows
- Both Appveyor and Github-Actions use `Encoding.default_external = UTF-8` in their default ruby versions on Windows. [Appveyor sets this](https://ci.appveyor.com/project/larskanis/github-action-test/build/job/v6vgrdu9iprxu6x3) per `RUBYOP...
-
09:29 AM Revision f0e2ea28 (git): Clarify spec and change of behavior for Random::DEFAULT
-
08:52 AM Bug #17349 (Closed): Rake での並行実行における正規表現マッチングの異常
- 小さな再現コードが作成できなかったのですが、以下のように Rake で並行実行すると正規表現のマッチングがおかしくなることがあるように見えます。
### 再現手順
``` shell
$ git clone https://github.com/mruby/mruby
$ cd mruby
$ git checkout 0cb3a718
$ rake -m CONFIG=boxing clean gensym
Cleaned up target b... -
08:42 AM Revision d4098377 (git): Cache access to reg_cfp->self on JIT
- ```
$ benchmark-driver -v --rbenv 'before --jit;after --jit' --repeat-count=12 --alternate --output=all benchmark.yml
before --jit: ruby 3.0.0dev (2020-11-27T06:41:15Z master 8ce1711c25) +JIT [x86_64-linux]
after --jit: ruby 3.0.0dev (20... -
08:36 AM Revision 5496415d (git): mark default_rand
- default_rand can points a Bignum seed, so it should be marked.
-
08:03 AM Feature #17322 (Closed): Deprecate `Random::DEFAULT` and introduce `Random.default()` method to provide Ractor-supported default random generator
- Applied in changeset commit:git|2db2fb9f6c742d5bd0019ccd11c7a375e1b12c0b.
----------
per-ractor Random::DEFAULT
Random generators are not Ractor-safe, so we need to prepare
per-ractor default random genearators. This patch set
`Random:... -
02:37 AM Feature #17322: Deprecate `Random::DEFAULT` and introduce `Random.default()` method to provide Ractor-supported default random generator
- Eregon (Benoit Daloze) wrote in #note-10:
> Is this needed? It sounds very bad practice from a security point of view to ever be able to read the seed directly
> ...
As you **must not** use the default RNG for security purpose, it does... -
08:03 AM Revision 2db2fb9f (git): per-ractor Random::DEFAULT
- Random generators are not Ractor-safe, so we need to prepare
per-ractor default random genearators. This patch set
`Random::DEFAULT = Randm` (not a Random instance, but the Random
class) and singleton methods like `Random.rand()` use a p... -
07:26 AM Feature #17342: Hash#fetch_set
- +1 for the feature. I have had chances to write what is proposed here several times.
marcandre (Marc-Andre Lafortune) wrote in #note-12:
> On Thu, Nov 26, 2020 at 9:05 PM <[email protected]> wrote:
> ...
Yes I’m quite sure he is d... -
06:05 AM Feature #17342: Hash#fetch_set
- On Thu, Nov 26, 2020 at 9:05 PM <[email protected]> wrote:
>
> ...
Please, let's be serious. `hash[obj] ||= something_that_changes_obj` is nonsense code. -
02:05 AM Feature #17342: Hash#fetch_set
- Eregon (Benoit Daloze) wrote in #note-8:
> Having it as a built-in method, it also makes it possible to avoid computing the key's `#hash` twice, and potentially avoid redoing the lookup in the Hash.
It is true **ideally**, but no one... -
06:41 AM Revision 8ce1711c (git): Revert "Set VM_FRAME_FLAG_FINISH at once on MJIT"
- This reverts commit 4d2c8edca69884a41d2f843d36023e3decdb9872.
Unfortunately this seems to cause several issues:
https://github.com/ruby/ruby/runs/1462188376?check_suite_focus=true
http://ci.rvm.jp/results/trunk-mjit-wait@phosphorus-dock... -
05:32 AM Revision 4d2c8edc (git): Set VM_FRAME_FLAG_FINISH at once on MJIT
- Performance is probably improved?
$ benchmark-driver -v --rbenv 'before --jit;after --jit' --repeat-count=12 --alternate --output=all benchmark.yml
before --jit: ruby 3.0.0dev (2020-11-27T04:37:47Z master 69e77e81dc) +JIT [x86_64-linux]... -
04:37 AM Revision 69e77e81 (git): Run rb_print_backtrace first on ruby_on_ci
- Unfortunately we couldn't see a C backtrace with the previous commit
http://ci.rvm.jp/results/trunk-random2@phosphorus-docker/3272697. -
04:31 AM Feature #17303: Remove webrick from stdlib
- Personally, I'm in favour of a smaller stdlib. Therefore I support this change.
I also believe that we see more innovation when things are allowed to grow under their own terms rather than part of stdlib. -
01:39 AM Feature #17303: Remove webrick from stdlib
- Thank you for your reply.
I'm sorry but I cannot afford to hire you and have no bugdet. If I were a billionaire..
Anyway, you are not against the removal of WEBrick from Ruby package.
If you are, let me know.
This is my opinion.
I... -
04:09 AM Revision 4dbf6f1e (git): Call rb_bug_without_die on CI
- when GC.compact's SEGV handler is installed
-
04:09 AM Revision 82541df0 (git): Separated tests for $KCODE and $=
-
03:47 AM Revision eca85404 (git): [DOC] Mersenne Twister isn't cryptographically secure [ci skip]
- 03:25 AM Revision ead32e6e (git): * 2020-11-27 [ci skip]
-
03:23 AM Revision 1898e955 (git): Always clean up leftovers at ci.rvm.jp
- to prevent failures like
http://ci.rvm.jp/logfiles/brlog.trunk-mjit.20201126-182515.
Since fa1250a506e9b6a1bcbf664f6b7b9c06e045d9b9, it should be safe to do
this.
11/26/2020
-
10:47 PM Feature #17307: A way to mark C extensions as thread-safe, Ractor-safe, or unsafe
- Eregon (Benoit Daloze) wrote in #note-15:
> shyouhei (Shyouhei Urabe) wrote in #note-14:
> ...
This is not what I know is a thread-safety. I understand what you need, but you should name the property differently than thread-safe, like... -
02:50 PM Feature #17307: A way to mark C extensions as thread-safe, Ractor-safe, or unsafe
- shyouhei (Shyouhei Urabe) wrote in #note-14:
> Am I missing something? This sounds eccentric to me. Whether a C function is thread safe or not is rather a common concept. "This C function is otherwise thread-safe unless any functions... -
10:26 PM Feature #17322: Deprecate `Random::DEFAULT` and introduce `Random.default()` method to provide Ractor-supported default random generator
- Despite the title of this issue, ko1’s intention is to make Ractor usable, not to make Random usable.
I think there still is a room to depreciate Random::DEFAULT. But if you want that I guess you can have a separate ticket. I guess ... -
03:14 PM Feature #17322: Deprecate `Random::DEFAULT` and introduce `Random.default()` method to provide Ractor-supported default random generator
- I see, it's to be compatible for `Random::DEFAULT.seed`, unfortunate.
I think we should deprecate the `Random::DEFAULT` constant, it doesn't make sense anymore and it's longer than using methods on Random or Kernel directly.
Also, pe... -
02:53 PM Feature #17322: Deprecate `Random::DEFAULT` and introduce `Random.default()` method to provide Ractor-supported default random generator
- Sounds great, except:
ko1 (Koichi Sasada) wrote in #note-8:
> * `Random.seed()` is added to return current seed of per-ractor default random generator.
Is this needed? It sounds very bad practice from a security point of view to e... -
05:56 AM Feature #17322: Deprecate `Random::DEFAULT` and introduce `Random.default()` method to provide Ractor-supported default random generator
- I vote for replacing `Random::DEFAULT` with ractor-safe object (`Random` class). We don't need `Random.default()` then.
Matz.
-
08:42 PM Bug #17331: Let Fiber#raise work with transferring fibers
- Thanks for taking a look.
ko1 (Koichi Sasada) wrote in #note-7:
> Sorry, could you explain the motivation and specification?
> ...
Motivation: ruby 2.7 `Fiber#raise` only works with yielding fibers (although this limitation isn't do... -
05:08 AM Bug #17331: Let Fiber#raise work with transferring fibers
- Basically positive for implicit one. The transferred fibers and suspended fibers behave differently, especially in exception propagation. You have to summarize the difference in the document.
Matz. -
08:24 PM Feature #17303: Remove webrick from stdlib
- [email protected] wrote:
> @normalperson What do you think?
I don't really care about Ruby, at the moment...
But if I were paid to care in the future, there is absolutely no
way I could use GitHub (due to Terms-of-Service, JS C... -
07:48 AM Feature #17303: Remove webrick from stdlib
- @normalperson What do you think?
-
08:03 PM Bug #17348: Shadowed method can not be evaluated on the line that it is shadowed
- In Ruby 3, you can write `a[0] => a` and that works :-)
-
07:07 PM Bug #17348 (Rejected): Shadowed method can not be evaluated on the line that it is shadowed
- This isn't a bug. It's expected that Ruby scans code and as soon as it encounters a local variable definition (the left hand side of `=`) it adds it to the local variable table. Changing this to not set the local variable until after th...
-
04:57 PM Bug #17348 (Rejected): Shadowed method can not be evaluated on the line that it is shadowed
- I encountered this in the code a junior Rubyist wrote. Rewriting to more logical code solved our problem, but in my opinion it should not have been an error. I reduced the code to this:
``` ruby
def a
""
end
a = a[0]
puts a.ins... -
07:02 PM Feature #13381: [PATCH] Expose rb_fstring and its family to C extensions
- Also if that helps, here's how it would be used by `json`: https://github.com/flori/json/pull/451
-
06:42 PM Feature #13381: [PATCH] Expose rb_fstring and its family to C extensions
- @alanwu just pointed to me that the confusion might come from the fact that this ticket need isn't quite the same than the one I originally opened: https://bugs.ruby-lang.org/issues/16029
They are close but not quite duplicates. @eagl... -
05:44 PM Feature #13381: [PATCH] Expose rb_fstring and its family to C extensions
- > It sounds like that fstring doesn't match that purpose.
I'm not sure why it wouldn't. Ultimately the prupose is the same than `String#-@`, but from the C API and by passing a `char *`.
> ...
It would be way less efficient, consid... -
07:41 AM Feature #13381: [PATCH] Expose rb_fstring and its family to C extensions
- It sounds like that `fstring` doesn't match that purpose.
Is it really better to divert `fstring` than separated string pools? -
04:12 PM Feature #17347 (Closed): Enumerator::Chain of Enumerator::Lazy should be lazy
- ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-linux]
Consider the following script:
``` ruby
a = [1,2,3].lazy
p a
b = [4,5,6].lazy
p b
c = a + b
p c
```
This gives the output:
```
#<Enumerator::Lazy: [1, 2, 3]>
#<En... -
03:29 PM Feature #17342: Hash#fetch_set
- MaxLap (Maxime Lapointe) wrote in #note-9:
> The Hash that we are using is not always under our control. In my second example, I'm using the `request_store` gem, which exposes as `Hash` (`RequestStore.store`), as cache.
I see, https:... -
02:53 PM Feature #17342: Hash#fetch_set
- I forgot to mention, but this pattern can also be more performant, as the key only needs to be hashed once for both the fetching and setting part. It's minor, but I do think of it everything I write the `fetch` pattern, and when the key ...
-
02:37 PM Feature #17342: Hash#fetch_set
- Another name for this is `compute_if_absent`.
It's notably the name used in concurrent-ruby:
http://ruby-concurrency.github.io/concurrent-ruby/1.1.5/Concurrent/Map.html#compute_if_absent-instance_method
And in Java, where it's even ... -
07:57 AM Feature #17342: Hash#fetch_set
- `fetch_set` mixes the concept of query with the concept of command and I think it's not a good approach.
Moreover I don't really see any big advantage in writing
```ruby
cache.fetch_set(key) { calculation }
```
vs
```ruby
cache.fet... -
04:01 AM Feature #17342: Hash#fetch_set
- XXX_or_YYY doesn't feel a good name in general.
Why does it need to be a method of `Hash`, and built-in?
Why not a separate class?
```ruby
class Cache < Hash
def fetch(key, &block)
super(key) {self[key] = yield(key)}
end... -
12:42 AM Feature #17342: Hash#fetch_set
- I didn't put an example using 2 parameters instead of a block, but yes, that option is also available. It has the same signature as a normal `fetch` would. In the examples, calculation was meant to be a complex thing, possibly a method c...
-
02:14 PM Misc #17346 (Closed): DevelopersMeeting20201210Japan
- # The next dev meeting
**Date: 2020/12/10 13:00-17:00**
Place/Sign-up/Agenda/Log: https://github.com/ruby/dev-meeting-log/blob/master/DevelopersMeeting20201210Japan.md
- Dev meeting *IS NOT* a decision-making place. All decisions ... -
02:13 PM Misc #17299 (Closed): DevelopersMeeting20201120Japan
-
12:33 PM Bug #17197: Some Hash methods still have arity 2 instead of 1
- @marcandre No. Issuing deprecation warnings itself is a declaration of future change. I haven't set my mind for either direction. Actually slightly leaning toward no change.
Matz.
-
12:26 PM Feature #12650: Use UTF-8 encoding for ENV on Windows
- A patch for ruby-3.0 is here: https://github.com/ruby/ruby/pull/3818
-
11:30 AM Bug #17306: TestGCCompact#test_ast_compacts test failures
- Testing with commit:git|6be9d18a4d and so far so good. Thank you.
-
11:20 AM Bug #17345 (Closed): ripper: nothing raised when assigning to keyword variables
- Applied in changeset commit:git|f5ca3ff4dbcf5c140a77d1de5ff3fe3eed2d558d.
----------
Store all kinds of syntax errors [Bug #17345] -
10:32 AM Bug #17345 (Closed): ripper: nothing raised when assigning to keyword variables
- ```ruby
require "ripper"
Ripper.tokenize("retry=1", raise_errors: true)
# => SyntaxError (syntax error, unexpected '=', expecting end-of-input)
Ripper.tokenize("nil=1", raise_errors: true) # => ["nil", "=", "1"]
lexer = Ripper::... -
11:14 AM Revision f5ca3ff4 (git): Store all kinds of syntax errors [Bug #17345]
-
11:03 AM Revision 1df38963 (git): Removed a duplicate assertion
-
09:46 AM Bug #17344 (Closed): `Ractor#shareable?` confused by recursive structures
- ```ruby
y = []; x = [y, {}].freeze; y << x; y.freeze
Ractor.shareable?(y) # => false, ok, the `{}` is not frozen
Ractor.shareable?(x) # => false, ok
Ractor.shareable?(y) # => true, not ok!
```
The error is that we can not mark an... -
09:44 AM Bug #17343 (Closed): Ractor can't clone frozen structures
- ```ruby
Ractor.new([[]].freeze) {} # => FrozenError
```
See https://github.com/ruby/ruby/pull/3817 -
08:54 AM Misc #17319: Rename Random.urandom to os_random and document random data sources
- zofrex (James Sanderson) wrote in #note-11:
> Thank for explaining the rationale behind the naming, I understand it now.
> ...
You may already read, Random.urandom actually don't use `/dev/urandom` on many OSes. On Linux it uses `getra... -
08:38 AM Misc #17319: Rename Random.urandom to os_random and document random data sources
- Thank for explaining the rationale behind the naming, I understand it now.
How would you feel about a patch just to update the documentation, and leave the method names as they are? The documentation still only lists openssl, urandom,... -
05:30 AM Misc #17319 (Rejected): Rename Random.urandom to os_random and document random data sources
- As https://bugs.ruby-lang.org/issues/9569#note-58 says, the name `urandom` insists it doesn't block.
Ruby often provide Unix emulation layer on Windows. I don't think this needs special treatment for Random.urandom.
Also you can easi... -
06:13 AM Revision 6be9d18a (git): Update TypeProf to 0.7.0
-
05:14 AM Feature #17326: Add Kernel#must! to the standard library
- I strongly oppose the name `must`. `must` assumes coercing something but no relation to types nor `nil`.
With a different name, there may be a chance for the method.
I think it's too late for 3.0. Maybe 3.1.
Matz.
-
12:37 AM Revision af80df18 (git): Keep patched zlib files
11/25/2020
-
11:25 PM Feature #17342: Hash#fetch_set
- chrisseaton (Chris Seaton) wrote in #note-3:
> `#fetch_or_set` could be a good name.
> ...
I can see the utilitiy, it would be good if it had a similar signature to #fetch :
```ruby
hsh = {}
hsh.fetch_or_set(:a, 1) # => 1, hsh = {... -
10:16 PM Feature #17342: Hash#fetch_set
- `#fetch_or_set` could be a good name.
> Why do we need a block for the second parameter? Can't that just be an ordinary parameter?
Because we don't want to do the work of calculating the initial value if it isn't needed because the... -
10:10 PM Feature #17342: Hash#fetch_set
- I think the feature in general is okay, but I have two concerns:
1) The name very easily suggests that the method is fetching a set, rather than fetching and setting at the same time.
2) Why do we need a block for the second parame... -
09:34 PM Feature #17342: Hash#fetch_set
- Thanks I've always wanted this feature. Whenever I write `cache.fetch(key) { cache[key] = calculation }` (or more often `cache.fetch(key) { |k| cache[k] = calculation }`) I think 'surely this pattern is worth making simpler.'
-
08:36 PM Feature #17342 (Feedback): Hash#fetch_set
- I would like to propose adding the `fetch_set` method to `Hash`. It behaves just like `fetch`, but when using the default value (2nd argument or the block), it also sets the value in the Hash for the given key.
We often use the patter... -
10:05 PM Revision e0944bde (git): Prefer rb_module_new() over rb_define_module_id()
- rb_define_module_id() doesn't do anything with its parameter so
it's a bit confusing. -
07:32 PM Feature #17322: Deprecate `Random::DEFAULT` and introduce `Random.default()` method to provide Ractor-supported default random generator
- At the last dev-meeting, there is an idea to replace `Random::DEFAULT` with an object which delegates operations to the per-ractor random generator.
Fortunately, `Random` class object can be a good placeholder because it already has `Ran... -
07:29 PM