[#107867] Fwd: [ruby-cvs:91197] 8f59482f5d (master): add some tests for Unicode Version 14.0.0 — Martin J. Dürst <duerst@...>
To everybody taking care of continuous integration:
3 messages
2022/03/13
[#108090] [Ruby master Bug#18666] No rule to make target 'yaml/yaml.h', needed by 'api.o' — duerst <noreply@...>
Issue #18666 has been reported by duerst (Martin D端rst).
7 messages
2022/03/28
[#108117] [Ruby master Feature#18668] Merge `io-nonblock` gems into core — "Eregon (Benoit Daloze)" <noreply@...>
Issue #18668 has been reported by Eregon (Benoit Daloze).
22 messages
2022/03/30
[ruby-core:107865] [Ruby master Bug#18624] `const_source_location` returns [false, 0] when autoload is defined for the constant
From:
"ufuk (Ufuk Kayserilioglu)" <noreply@...>
Date:
2022-03-12 15:53:34 UTC
List:
ruby-core #107865
Issue #18624 has been updated by ufuk (Ufuk Kayserilioglu). jeremyevans0 (Jeremy Evans) wrote in #note-4: > Sorry, but you are incorrect. #17354 is regarding behavior of `const_source_location` before the autoloaded file is required. This issue is regarding behavior of `const_source_location` after the autoloaded file is required. They are separate issues, not duplicates, and should be treated as such. This issue is definitely a bug, because the related constant has already been defined and the source of the constant is now known. Indeed, thanks for the correction. I had missed the `require path` line in the original reproduction example. Apologies for the noise and thanks again for the clarification. ---------------------------------------- Bug #18624: `const_source_location` returns [false, 0] when autoload is defined for the constant https://bugs.ruby-lang.org/issues/18624#change-96806 * Author: pocke (Masataka Kuwabara) * Status: Open * Priority: Normal * ruby -v: ruby 3.2.0dev (2022-03-11T08:38:13Z master 2e4516be26) [x86_64-linux] * Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- `const_source_location` returns `[false, 0]` unexpectedly with the following code. ```ruby # test.rb path = File.join(__dir__, 'test2') Object.autoload 'Test2', path require path p Object.const_source_location 'Test2' ``` ```ruby # test2.rb class Test2 end ``` ```bash $ ruby -v test.rb ruby 3.2.0dev (2022-03-11T08:38:13Z master 2e4516be26) [x86_64-linux] [false, 0] ``` I expect it returns `['/path/to/test2.rb', 2]`, but it doesn't. Ruby 2.7 ~ 3.1 have the same behavior. I actually encountered this problem in a Rails app with Zeitwerk. The following codes are a reproducing example with Zeitwerk. `loader.setup` calls `autoload`, so it causes the same problem. ```ruby # test.rb require "zeitwerk" loader = Zeitwerk::Loader.for_gem loader.setup require File.join(__dir__, 'test2') p Zeitwerk::VERSION p Object.const_source_location 'Test2' ``` ```ruby # test2.rb class Test2 end ``` -- https://bugs.ruby-lang.org/ Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>