CARVIEW |
Select Language
HTTP/2 200
x-amz-id-2: WEsCTveMpA4H9v18zyA8Rc+ID06t6AF9eHN9dob/yXm4MTdH+d0NA8rzVBKT73R3OcxRyEComjMg6WyeKUBvKUraYEDzGO5LWUqC7c8SxLE=
x-amz-request-id: 3HQFD9H3GK6N5BM2
last-modified: Wed, 14 May 2025 14:30:45 GMT
etag: "5d9ed82358942db08e50f15e1fd709b0"
x-amz-server-side-encryption: AES256
server: AmazonS3
content-encoding: gzip
via: 1.1 varnish, 1.1 varnish
content-type: text/plain; charset=utf-8
accept-ranges: bytes
age: 0
date: Thu, 24 Jul 2025 07:02:40 GMT
x-served-by: cache-tyo11952-TYO, cache-bom-vanm7210032-BOM
x-cache: MISS, MISS
x-cache-hits: 0, 0
x-timer: S1753340560.316998,VS0,VE349
vary: Accept-Encoding
content-length: 828
From: "byroot (Jean Boussier) via ruby-core"
Date: 2025-05-14T14:20:57+00:00
Subject: [ruby-core:122098] [Ruby Bug#21339] Namespace: `RubyVM::InstructionSequence.load_iseq` isn't called for the root namespace
Issue #21339 has been reported by byroot (Jean Boussier).
----------------------------------------
Bug #21339: Namespace: `RubyVM::InstructionSequence.load_iseq` isn't called for the root namespace
https://bugs.ruby-lang.org/issues/21339
* Author: byroot (Jean Boussier)
* Status: Assigned
* Assignee: tagomoris (Satoshi Tagomori)
* ruby -v: ruby 3.5.0dev (2025-05-14T12:41:46Z master b5575a80bc) +PRISM [arm64-darwin24]
* Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN
----------------------------------------
```ruby
File.write("/tmp/compile-cache.rb", <<~'RUBY')
class << RubyVM::InstructionSequence
def load_iseq(path)
p [:load_iseq, path]
RubyVM::InstructionSequence.compile_file(path)
end
end
RUBY
File.write("/tmp/test-file.rb", "")
puts "main:"
require "/tmp/compile-cache.rb"
require "/tmp/test-file.rb"
if ENV["RUBY_NAMESPACE"]
puts "namespace:"
ns = Namespace.new
ns.require("/tmp/compile-cache.rb")
ns.require("/tmp/test-file.rb")
end
```
Expected behavior:
I would expect `load_iseq` to be invoked both in the root namespace and the user namespace when `RUBY_NAMESPACE=1`.
Actual behavior:
Somehow it's only invoked in the user namespace:
```bash
main:
[:compile_cache_setup]
[:load_iseq, "/tmp/test-file.rb"]
```
```bash
main:
[:compile_cache_setup]
namespace:
[:compile_cache_setup]
[:load_iseq, "/tmp/test-file.rb"]
```
But I don't understand why.
--
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/lists/ruby-core.ml.ruby-lang.org/