The error is this: >>> Install dev-ruby/rb-inotify-0.10.1 into /var/tmp/portage/dev-ruby/rb-inotify-0.10.1/image * Running install phase for ruby27 Traceback (most recent call last): 6: from -e:1:in `<main>' 5: from /usr/lib64/ruby/site_ruby/2.7.0/rubygems/specification.rb:1096:in `from_yaml' 4: from /usr/lib64/ruby/site_ruby/2.7.0/rubygems/safe_yaml.rb:30:in `safe_load' 3: from /usr/lib64/ruby/gems/2.7.0/gems/psych-5.1.0/lib/psych.rb:323:in `safe_load' 2: from /usr/lib64/ruby/gems/2.7.0/gems/psych-5.1.0/lib/psych.rb:399:in `parse' 1: from /usr/lib64/ruby/gems/2.7.0/gems/psych-5.1.0/lib/psych.rb:455:in `parse_stream' /usr/lib64/ruby/gems/2.7.0/gems/psych-5.1.0/lib/psych/parser.rb:62:in `parse': undefined method `_native_parse' for #<Psych::Parser:0x0000562e0f1b01f0> (NoMethodError) Attaching the build log in a second...
Created attachment 859592 [details] Build log
What version of dev-ruby/safe_yaml is installed?
PS: This is without dev-ruby/safe_yaml installed. For proof: # qfile /usr/lib64/ruby/site_ruby/2.7.0/rubygems/safe_yaml.rb dev-ruby/rubygems: /usr/lib64/ruby/site_ruby/2.7.0/rubygems/safe_yaml.rb
(In reply to Sebastian Pipping from comment #3) > PS: This is without dev-ruby/safe_yaml installed. For proof: > > # qfile /usr/lib64/ruby/site_ruby/2.7.0/rubygems/safe_yaml.rb > dev-ruby/rubygems: /usr/lib64/ruby/site_ruby/2.7.0/rubygems/safe_yaml.rb Can you try install it (>=1.0.5-r2)? I think it'll override the bundled one with Ruby 2.7 and fix your issue. For ruby2.7, we should probably make psych at least depend on that safe_yaml. Not that any of this matters that much anyway, as ruby27 is rapidly heading for the bin.
(In reply to Sam James from comment #4) > Can you try install it (>=1.0.5-r2)? Tried just now, installing dev-ruby/safe_yaml-1.0.5-r2 fails with the very same "undefined method" error.
Created attachment 859953 [details] Build log I just learned that Ruby 3.0.0 is affected also, this is not a 2.7-only problem.
What allowed be to install dev-ruby/rb-inotify successfully now is this *workaround*: mv /usr/lib64/ruby/gems/3.0.0/gems/psych-5.1.0{,_RENAMED} mv /usr/lib64/ruby/gems/3.1.0/gems/psych-5.1.0{,_RENAMED} (This assumes that one has =dev-ruby/psych-5.1.0 installed with "ruby30 ruby31 ruby32 -ruby27", else it may need one more rename for 2.7.) What the workaround does is it makes Ruby use its own copy of Psych rather than the gem's one. I believe that means that Ruby has trouble loading the correct psych.so when the Gem is installed. PS: Symbol "_native_parse" was first introduced… - with Ruby 3_2_0_preview3 at https://github.com/ruby/ruby/commit/26135312f61014967ef223dd16ad6577ebd9c5d8 - with Psych 5.0.0 at https://github.com/ruby/psych/commit/bca7d2c54942205e9364f8b0c0a1948fd1442ec8
I wish I could reproduce this. I think it's possible that it needs special care when unbundling or similar, but I don't know yet. If you do have some time, I'd appreciate it if you could find some instructions to run from a clean stage 3 to make it happen, but no obligation.
(In reply to Sam James from comment #8) > I wish I could reproduce this. I'm still playing with a reproducer, but I believe it may take nothing but: 1. Ruby 2.7, 3.0 or 3.1 (but not 3.2) 2. >=dev-ruby/psych-5 installed 3. ruby32 -e $'require "psych"\nPsych.parse("---")' # fine 4. ruby30 -e $'require "psych"\nPsych.parse("---")' # crashes > If you do have some time, I'd appreciate it if you could find some > instructions to run from a clean stage 3 to make it happen, but no > obligation. With some luck, I'll have a Dockerfile to reproduce with latest gentoo/stage3 soon, let's see.
(In reply to Sebastian Pipping from comment #9) > With some luck, I'll have a Dockerfile to reproduce with latest > gentoo/stage3 soon, let's see. Turns out difficult. Also, for some reason def-lang/ruby:3.0 brings /usr/lib64/ruby/gems/3.0.0/gems/psych-3.3.2 as well, giving this full picture: # ls -ad /usr/lib64/ruby/gems/*/gems/psych-*/ | xargs qfile dev-lang/ruby: /usr/lib64/ruby/gems/3.0.0/gems/psych-3.3.2 dev-ruby/psych: /usr/lib64/ruby/gems/3.1.0/gems/psych-5.1.0 dev-ruby/psych: /usr/lib64/ruby/gems/3.0.0/gems/psych-5.1.0 For anyone who likes to continue where I left off, my Dockerfile was this: FROM gentoo/stage3 RUN emerge-webrsync RUN echo 'ACCEPT_KEYWORDS="amd64 ~amd64"' >> /etc/portage/make.conf RUN echo 'RUBY_TARGETS="ruby30 ruby31"' >> /etc/portage/make.conf RUN emerge -j2 -v --tree dev-ruby/psych RUN ls -ad /usr/lib64/ruby/gems/*/gems/psych-*/ | xargs qfile RUN ruby30 -e $'require "psych"\nPsych.parse("---")' RUN ruby31 -e $'require "psych"\nPsych.parse("---")'
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=460c97b79bf0962e9da7e11c6bbda13bd8c91ddb commit 460c97b79bf0962e9da7e11c6bbda13bd8c91ddb Author: Sam James <sam@gentoo.org> AuthorDate: 2024-06-24 05:35:59 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-06-24 19:40:35 +0000 profiles/base: mask dev-lang/ruby[static-libs] It breaks gem installation in mysterious ways and people keep tripping over it. graaff indicates on the PR that we'd like to remove it entirely for ruby:3.4 given it'll bitrot if it's masked, but that this is a good option for now. Closes: https://bugs.gentoo.org/887223 Closes: https://bugs.gentoo.org/891367 Closes: https://bugs.gentoo.org/903891 Closes: https://bugs.gentoo.org/917139 Signed-off-by: Sam James <sam@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/37267 Signed-off-by: Sam James <sam@gentoo.org> profiles/base/package.use.mask | 5 +++++ 1 file changed, 5 insertions(+)