From: "byroot (Jean Boussier) via ruby-core" Date: 2026-09-30T09:14:01+00:00 Subject: [ruby-core:126890] [Ruby Feature#22395] RubyVM::InstructionSequence.load_from_binary: to optionally accept `file` and `path` arguments Issue #22395 has been reported by byroot (Jean Boussier). ---------------------------------------- Feature #22395: RubyVM::InstructionSequence.load_from_binary: to optionally accept `file` and `path` arguments https://bugs.ruby-lang.org/issues/22395 * Author: byroot (Jean Boussier) * Status: Open ---------------------------------------- ### Context I'm trying to fix the long standing [Feature #17593] issue. In short, ISeq caching has a problematic limitation that the path and realpath of the source file is embedded in the iseq. Meaning that if you build your application in a different path than where you later run it, the iseq cache becomes invalid, which is very problematic for some build systems like buildpacks. [Feature #17593] proposed for `load_iseq_eval` to override these paths, but that would mean mutating or duping the iseq which I think would either be dangerous or inneficient. Hence I think to solve that issue we need some change to the public API. ### Proposed changes Change: ```ruby RubyVM::InstructionSequence.load_from_binary(binary) ��� iseq ``` to: ```ruby RubyVM::InstructionSequence.load_from_binary(binary [, file[, path]]) ��� iseq ``` These optional parameters are consistent with `ISeq.compile`. Consequently, `VALUE rb_iseq_load_from_binary(const char *ptr, size_t len)` that was introduced in [Feature #22222] (hence not yet released) would become: `VALUE rb_iseq_load_from_binary(const char *ptr, size_t len, VALUE file, VALUE path)`. ### Proposed patch https://github.com/ruby/ruby/pull/18924 -- 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/