Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.

psych 4.x breaks libv8 .location.yml deserialisation during extension building #322

Closed
poloka opened this issue Jan 4, 2022 · 3 comments · Fixed by #323
Closed

psych 4.x breaks libv8 .location.yml deserialisation during extension building #322

poloka opened this issue Jan 4, 2022 · 3 comments · Fixed by #323

Comments

@poloka
Copy link
Contributor

poloka commented Jan 4, 2022

Experiencing similar issue to rubyjs/mini_racer#208 in that the attempt to load the .location.yml. Believe the introduced fix rubyjs/libv8-node@6bbb084 should be the same to update in this library.
https://github.com/rubyjs/libv8/blob/v8.4.255.0/ext/libv8/location.rb#L16

I validated that the file that was attempting to load noted

/Users/gh7199/.rvm/gems/ruby-2.6.6@embedded_content_engine/gems/libv8-3.16.14.19/ext/libv8/.location.yml
Installing therubyracer 0.12.3 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/gh7199/.rvm/gems/ruby-2.6.6@embedded_content_engine/gems/therubyracer-0.12.3/ext/v8
/Users/gh7199/.rvm/rubies/ruby-2.6.6/bin/ruby -I /Users/gh7199/.rvm/rubies/ruby-2.6.6/lib/ruby/site_ruby/2.6.0 -r ./siteconf20220104-25212-1w22w49.rb extconf.rb --with-v8-dir\=/usr/local/opt/[email protected]
checking for -lpthread... yes
checking for -lobjc... yes
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
	--with-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/Users/gh7199/.rvm/rubies/ruby-2.6.6/bin/$(RUBY_BASE_NAME)
	--with-pthreadlib
	--without-pthreadlib
	--with-objclib
	--without-objclib
	--enable-debug
	--disable-debug
/Users/gh7199/.rvm/gems/ruby-2.6.6@embedded_content_engine/gems/psych-4.0.3/lib/psych/class_loader.rb:99:in `find': Tried to load unspecified class: Libv8::Location::System (Psych::DisallowedClass)
	from /Users/gh7199/.rvm/gems/ruby-2.6.6@embedded_content_engine/gems/psych-4.0.3/lib/psych/class_loader.rb:28:in `load'
	from /Users/gh7199/.rvm/gems/ruby-2.6.6@embedded_content_engine/gems/psych-4.0.3/lib/psych/visitors/to_ruby.rb:424:in `resolve_class'
	from /Users/gh7199/.rvm/gems/ruby-2.6.6@embedded_content_engine/gems/psych-4.0.3/lib/psych/visitors/to_ruby.rb:213:in `visit_Psych_Nodes_Mapping'
	from /Users/gh7199/.rvm/gems/ruby-2.6.6@embedded_content_engine/gems/psych-4.0.3/lib/psych/visitors/visitor.rb:30:in `visit'
	from /Users/gh7199/.rvm/gems/ruby-2.6.6@embedded_content_engine/gems/psych-4.0.3/lib/psych/visitors/visitor.rb:6:in `accept'
	from /Users/gh7199/.rvm/gems/ruby-2.6.6@embedded_content_engine/gems/psych-4.0.3/lib/psych/visitors/to_ruby.rb:35:in `accept'
	from /Users/gh7199/.rvm/gems/ruby-2.6.6@embedded_content_engine/gems/psych-4.0.3/lib/psych/visitors/to_ruby.rb:318:in `visit_Psych_Nodes_Document'
	from /Users/gh7199/.rvm/gems/ruby-2.6.6@embedded_content_engine/gems/psych-4.0.3/lib/psych/visitors/visitor.rb:30:in `visit'
	from /Users/gh7199/.rvm/gems/ruby-2.6.6@embedded_content_engine/gems/psych-4.0.3/lib/psych/visitors/visitor.rb:6:in `accept'
	from /Users/gh7199/.rvm/gems/ruby-2.6.6@embedded_content_engine/gems/psych-4.0.3/lib/psych/visitors/to_ruby.rb:35:in `accept'
	from /Users/gh7199/.rvm/gems/ruby-2.6.6@embedded_content_engine/gems/psych-4.0.3/lib/psych.rb:335:in `safe_load'
	from /Users/gh7199/.rvm/gems/ruby-2.6.6@embedded_content_engine/gems/psych-4.0.3/lib/psych.rb:370:in `load'
	from /Users/gh7199/.rvm/gems/ruby-2.6.6@embedded_content_engine/gems/libv8-3.16.14.19/ext/libv8/location.rb:17:in `block in load!'
	from /Users/gh7199/.rvm/gems/ruby-2.6.6@embedded_content_engine/gems/libv8-3.16.14.19/ext/libv8/location.rb:15:in `open'
	from /Users/gh7199/.rvm/gems/ruby-2.6.6@embedded_content_engine/gems/libv8-3.16.14.19/ext/libv8/location.rb:15:in `load!'
	from /Users/gh7199/.rvm/gems/ruby-2.6.6@embedded_content_engine/gems/libv8-3.16.14.19/lib/libv8.rb:6:in `configure_makefile'
	from extconf.rb:32:in `<main>'
@poloka
Copy link
Contributor Author

poloka commented Jan 4, 2022

Since I am stuck on libv8-3.16.14.19 at the moment, is there a process for releasing a 3.16.14.20 version with the fix as well? I'd branch from a tag and release from the branch but didn't see any branches for each individual major release.

@Vineeta2000
Copy link

Iam facing this error when i install rubyracer and libv8 for installimg therubyracer.Can anyone help me to solve this problem.Thank you

acareindore@As-MacBook-Pro gyuvasoft % gem install libv8 -v 3.16.14.15 -- --with-system-v8
Building native extensions with: '--with-system-v8'
This could take a while...
Successfully installed libv8-3.16.14.15
Parsing documentation for libv8-3.16.14.15
Done installing documentation for libv8 after 0 seconds
1 gem installed
acareindore@As-MacBook-Pro gyuvasoft % libv8 -v
zsh: command not found: libv8
acareindore@As-MacBook-Pro gyuvasoft % gem install therubyracer -v 0.12.3
Building native extensions. This could take a while...
ERROR: Error installing therubyracer:
ERROR: Failed to build gem native extension.

current directory: /Users/acareindore/.rvm/gems/ruby-3.1.3/gems/therubyracer-0.12.3/ext/v8

/Users/acareindore/.rvm/rubies/ruby-3.1.3/bin/ruby -I /Users/acareindore/.rvm/rubies/ruby-3.1.3/lib/ruby/site_ruby/3.1.0 extconf.rb
checking for -lpthread... yes
checking for -lobjc... yes
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/acareindore/.rvm/rubies/ruby-3.1.3/bin/$(RUBY_BASE_NAME)
--with-pthread-dir
--without-pthread-dir
--with-pthread-include
--without-pthread-include=${pthread-dir}/include
--with-pthread-lib
--without-pthread-lib=${pthread-dir}/lib
--with-pthreadlib
--without-pthreadlib
--with-objc-dir
--without-objc-dir
--with-objc-include
--without-objc-include=${objc-dir}/include
--with-objc-lib
--without-objc-lib=${objc-dir}/lib
--with-objclib
--without-objclib
--enable-debug
--disable-debug
/Users/acareindore/.rvm/rubies/ruby-3.1.3/lib/ruby/3.1.0/psych/class_loader.rb:99:in find': Tried to load unspecified class: Libv8::Location::System (Psych::DisallowedClass) from /Users/acareindore/.rvm/rubies/ruby-3.1.3/lib/ruby/3.1.0/psych/class_loader.rb:28:in load'
from /Users/acareindore/.rvm/rubies/ruby-3.1.3/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:424:in resolve_class' from /Users/acareindore/.rvm/rubies/ruby-3.1.3/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:213:in visit_Psych_Nodes_Mapping'
from /Users/acareindore/.rvm/rubies/ruby-3.1.3/lib/ruby/3.1.0/psych/visitors/visitor.rb:30:in visit' from /Users/acareindore/.rvm/rubies/ruby-3.1.3/lib/ruby/3.1.0/psych/visitors/visitor.rb:6:in accept'
from /Users/acareindore/.rvm/rubies/ruby-3.1.3/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:35:in accept' from /Users/acareindore/.rvm/rubies/ruby-3.1.3/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:318:in visit_Psych_Nodes_Document'
from /Users/acareindore/.rvm/rubies/ruby-3.1.3/lib/ruby/3.1.0/psych/visitors/visitor.rb:30:in visit' from /Users/acareindore/.rvm/rubies/ruby-3.1.3/lib/ruby/3.1.0/psych/visitors/visitor.rb:6:in accept'
from /Users/acareindore/.rvm/rubies/ruby-3.1.3/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:35:in accept' from /Users/acareindore/.rvm/rubies/ruby-3.1.3/lib/ruby/3.1.0/psych.rb:334:in safe_load'
from /Users/acareindore/.rvm/rubies/ruby-3.1.3/lib/ruby/3.1.0/psych.rb:369:in load' from /Users/acareindore/.rvm/gems/ruby-3.1.3/gems/libv8-3.16.14.19/ext/libv8/location.rb:16:in block in load!'
from /Users/acareindore/.rvm/gems/ruby-3.1.3/gems/libv8-3.16.14.19/ext/libv8/location.rb:15:in open' from /Users/acareindore/.rvm/gems/ruby-3.1.3/gems/libv8-3.16.14.19/ext/libv8/location.rb:15:in load!'
from /Users/acareindore/.rvm/gems/ruby-3.1.3/gems/libv8-3.16.14.19/lib/libv8.rb:6:in configure_makefile' from extconf.rb:32:in

'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

/Users/acareindore/.rvm/gems/ruby-3.1.3/extensions/x86_64-darwin-20/3.1.0/therubyracer-0.12.3/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Users/acareindore/.rvm/gems/ruby-3.1.3/gems/therubyracer-0.12.3 for inspection.
Results logged to /Users/acareindore/.rvm/gems/ruby-3.1.3/extensions/x86_64-darwin-20/3.1.0/therubyracer-0.12.3/gem_make.out

@mansoor-sajjad
Copy link

@Vineeta2000 Did you found the solution?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants