mini_racer: psych 4.x breaks libv8 `.location.yml` deserialisation during extension building

mini_racer deserialises some innocuous Ruby class serialised as YAML in the libv8-node gem, but psych 4.0 changed some behaviours around YAML.load to be more like safe_load.

A temporary workaround should be to revert to psych < 4.0.

I should be able to push a fix as soon as I get a window of opportunity to repro.

/Users/username/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/psych-4.0.0/lib/psych/class_loader.rb:99:in `find': Tried to load unspecified class: Libv8::Node::Location::Vendor (Psych::DisallowedClass)
	from /Users/username/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/psych-4.0.0/lib/psych/class_loader.rb:28:in `load'
	from /Users/username/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:424:in `resolve_class'
	from /Users/username/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:213:in `visit_Psych_Nodes_Mapping'
	from /Users/username/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/psych-4.0.0/lib/psych/visitors/visitor.rb:30:in `visit'
	from /Users/username/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/psych-4.0.0/lib/psych/visitors/visitor.rb:6:in `accept'
	from /Users/username/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:35:in `accept'
	from /Users/username/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:318:in `visit_Psych_Nodes_Document'
	from /Users/username/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/psych-4.0.0/lib/psych/visitors/visitor.rb:30:in `visit'
	from /Users/username/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/psych-4.0.0/lib/psych/visitors/visitor.rb:6:in `accept'
	from /Users/username/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:35:in `accept'
	from /Users/username/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/psych-4.0.0/lib/psych.rb:334:in `safe_load'
	from /Users/username/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/psych-4.0.0/lib/psych.rb:369:in `load'
	from /Users/username/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/sq_mini_racer-0.3.1.0.4/ext/mini_racer_extension/vendor/gems/libv8-node-15.5.1.0.beta1-x86_64-darwin-20/ext/libv8-node/location.rb:18:in `block in load!'
	from /Users/username/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/sq_mini_racer-0.3.1.0.4/ext/mini_racer_extension/vendor/gems/libv8-node-15.5.1.0.beta1-x86_64-darwin-20/ext/libv8-node/location.rb:17:in `open'
	from /Users/username/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/sq_mini_racer-0.3.1.0.4/ext/mini_racer_extension/vendor/gems/libv8-node-15.5.1.0.beta1-x86_64-darwin-20/ext/libv8-node/location.rb:17:in `load!'
	from /Users/username/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/sq_mini_racer-0.3.1.0.4/ext/mini_racer_extension/vendor/gems/libv8-node-15.5.1.0.beta1-x86_64-darwin-20/lib/libv8/node.rb:8:in `configure_makefile'
	from extconf.rb:259:in `<main>'

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15

Most upvoted comments

Soon @SamSaffron, I’m looking into some other possible quick fixes to stuff in there.

… and I have mini_racer + node 16 (v8 9.0) running great over here 😃

all good!

correct