Conversation
- Remove mruby-print dependency (merged into mruby core in 3.4.0) - Remove mruby/mruby#5318 patch (fixed upstream since 3.1.0) - Delete build_config.rb.lock for regeneration
mruby 3.4.0 includes mruby-dir as a core gem. The external iij/mruby-dir fails to compile due to missing error.h header.
- Use **opts for keyword argument forwarding instead of hash-as-last-arg pattern, since mruby 3.4.0 separates positional hashes from kwargs - Add explicit Node#merge! to avoid method_missing delegation issues with private method visibility enforcement in mruby 3.4.0 - Override String#shellescape and Array#shelljoin to call public module_function names instead of private singleton aliases
module_function in mruby 3.4.0 doesn't create public singleton methods, making Shellwords.shellescape and Shellwords.shelljoin inaccessible. Inline the implementation into String#shellescape and Array#shelljoin, and use instance method calls instead of Shellwords module methods.
- Use ::File.open instead of File.open in ResourceExecutor::File to avoid resolving to the inner File class + Kernel#open (private) - Redefine Open3.capture3/capture2/capture2e as explicit public class methods since module_function creates private singleton methods in mruby 3.4.0
- Define Shellwords.shellescape/shelljoin as explicit public singleton methods (def self.xxx) so external gems like specinfra can call them - Change RecipeLoader#initialize to use keyword arguments instead of a positional hash, fixing hash-to-kwargs conversion in mruby 3.4.0
In mruby 3.4.0, the [] operator in precompiled bytecode dispatches directly to C-level Hash#[] via OP_GETIDX, bypassing Ruby method overrides including Hashie::Mash's alias_method :[], :custom_reader. This means symbol keys like attributes[:action] hit Hash#[] without Mash's key conversion (symbol -> string), returning nil. Fix by using string keys when accessing Hashie::Mash from precompiled code in resource/base.rb, resource_context.rb, and resource_executor.
- Use string keys in Node#[] when accessing @mash to avoid the OP_GETIDX optimization that bypasses Hashie::Mash's key conversion - Make Kernel#` accessible by redefining it in compat.rb, since module_function makes it private in mruby 3.4.0
mruby 3.4.0 changed Hash#to_s format. Hashie::Mash objects now render
as #<Hashie::Mash key=val> instead of {"key"=>"val"}. Update regexes
to match both old and new formats.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mruby-printdependency (merged into mruby core in 3.4.0)hostdon't refermrbcinhostmruby/mruby#5318 patch (fixed upstream since 3.1.0)build_config.rb.lockfor regenerationCloses #119, closes #125