From: "byroot (Jean Boussier) via ruby-core" Date: 2023-02-06T11:58:37+00:00 Subject: [ruby-core:112231] [Ruby master Bug#19415] Incorrect circularity warning for concurrent requires Issue #19415 has been updated by byroot (Jean Boussier). Backport changed from 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN to 2.7: WONTFIX, 3.0: WONTFIX, 3.1: REQUIRED, 3.2: REQUIRED I have a patch for this: https://github.com/ruby/ruby/pull/7252 That bug isn't very critical, but I think it wouldn't hurt to backport it, at least on recent versions. ---------------------------------------- Bug #19415: Incorrect circularity warning for concurrent requires https://bugs.ruby-lang.org/issues/19415#change-101654 * Author: fxn (Xavier Noria) * Status: Open * Priority: Normal * Backport: 2.7: WONTFIX, 3.0: WONTFIX, 3.1: REQUIRED, 3.2: REQUIRED ---------------------------------------- This script performs 5 concurrent `require` calls to the same file: ```ruby threads = [] 5.times do threads << Thread.new { p require 'bar' } end threads.each(&:join) ``` The file `bar.rb` is simply ```ruby sleep 0.1 ``` Now, if you execute the main script with warnings enabled: ``` ruby -W2 -I. foo.rb ``` you'll see one `true` and four `false` as expected. But also four warnings: ``` circular require considered harmful - /Users/fxn/tmp/bar.rb ``` As you see, there isn't really a circular `require` going on, so the warning itself is incorrect. On the other hand, concurrent `require` calls for the same file is something routinely happening and supported. I'd suggest that script should issue no warning. -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/