Feature #22395
openRubyVM::InstructionSequence.load_from_binary: to optionally accept `file` and `path` arguments
Description
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:
to:
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¶
No data to display