From: "altruby (Alt Ruby) via ruby-core" Date: 2026-11-03T20:29:23+00:00 Subject: [ruby-core:127320] [Ruby Feature#22478] RbConfig::CONFIG could be Ractor-shareable by default? Issue #22478 has been updated by altruby (Alt Ruby). Could `RbConfig::RACTOR_CONFIG` be added? This works. I admit it is strange. I don't think Ractor provides a way to do a deep copy so RbConfig::CONFIG is copied, frozen and returned to the main Ractor. I don't suggest ruby do something like this, but maybe RbConfig::RACTOR_CONFIG could be added to the same effect. ```ruby module RbConfig RACTOR_CONFIG = Ractor.new(RbConfig::CONFIG) { Ractor.make_shareable(it) }.value def self.ruby File.join( RACTOR_CONFIG["bindir"], RACTOR_CONFIG["ruby_install_name"] + RACTOR_CONFIG["EXEEXT"] ) end end Ractor.new do Process.wait Process.spawn(RbConfig.ruby, "-e", "p 123") end.value ## # All false p RbConfig::CONFIG.frozen? p RbConfig::CONFIG["INSTALL"].frozen? ## # All true p RbConfig::RACTOR_CONFIG.frozen? p RbConfig::RACTOR_CONFIG["INSTALL"].frozen? ``` ``` ---------------------------------------- Feature #22478: RbConfig::CONFIG could be Ractor-shareable by default? https://bugs.ruby-lang.org/issues/22478#change-119746 * Author: altruby (Alt Ruby) * Status: Open ---------------------------------------- Hi Is this intentional? The following code fails due to `Ractor::CONFIG` not being Ractor-shareable. ```ruby ## # Ractor::IsolationError require "rbconfig" Ractor.new { Process.wait Process.spawn(RbConfig.ruby, "-e", "p 123") }.value ```` This works fine but wouldn't be backwards compatible: ```ruby require "rbconfig" Ractor.make_shareable(RbConfig::CONFIG) Ractor.new { Process.wait Process.spawn(RbConfig.ruby, "-e", "p 123") }.value ``` Would it be acceptable for `RbConfig::CONFIG` to be deeply frozen, by default? Thanks, -- 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/