Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 835405 - dev-ruby/safe_yaml-1.0.5-r1 fails tests on MUSL
Summary: dev-ruby/safe_yaml-1.0.5-r1 fails tests on MUSL
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Ruby Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-16 07:44 UTC by Agostino Sarubbo
Modified: 2022-06-16 17:40 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,56.08 KB, text/plain)
2022-03-16 07:44 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2022-03-16 07:44:06 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: dev-ruby/safe_yaml-1.0.5-r1 fails tests on MUSL.
Discovered on: amd64 (internal ref: tinderbox_musl)

NOTE:
This machine uses MUSL libc
Comment 1 Agostino Sarubbo gentoo-dev 2022-03-16 07:44:08 UTC
Created attachment 767141 [details]
build.log

build log and emerge --info
Comment 2 Agostino Sarubbo gentoo-dev 2022-03-16 07:44:08 UTC
Error(s) that match a know pattern:


        expected no Exception, got #<ArgumentError: wrong number of arguments (given 2, expected 1)> with backtrace:
       expected no Exception, got #<ArgumentError: wrong number of arguments (given 2, expected 1)> with backtrace:
      ArgumentError:
      Failure/Error: File.open(filename, 'r:bom|utf-8') { |f| self.unsafe_load(f, filename) }
      Failure/Error: Psych.parse(yaml, filename) :
      Failure/Error: expect { result = YAML.safe_load(instance.to_yaml) }.to_not raise_error
      Failure/Error: unsafe_load(*arguments)
     ArgumentError:
     Failure/Error: Psych.parse(yaml, filename) :
     Failure/Error: expect { result = YAML.safe_load "--- ! 'foo'" }.to_not raise_error
     Failure/Error: expect(backdoor).to be_exploited_through_init_with
     Failure/Error: expect(backdoor).to be_exploited_through_ivars
     Failure/Error: expect(backdoor).to be_exploited_through_setter
.........................FFFF................FFFWARNING: Using the `raise_error` matcher without providing a specific error or message risks false positives, since `raise_error` will match when Ruby raises a `NoMethodError`, `NameError` or `ArgumentError`, potentially allowing the expectation to pass without even executing the method you are intending to call. Actual error raised was #<ArgumentError: wrong number of arguments (given 2, expected 1)>. Instead consider providing a specific error class or message. This message can be suppressed by setting: `RSpec::Expectations.configuration.on_potential_false_positives = :nothing`. Called from /var/tmp/portage/dev-ruby/safe_yaml-1.0.5-r1/work/ruby26/safe_yaml-1.0.5/spec/safe_yaml_spec.rb:353:in `block (5 levels) in <top (required)>'.
.WARNING: Using the `raise_error` matcher without providing a specific error or message risks false positives, since `raise_error` will match when Ruby raises a `NoMethodError`, `NameError` or `ArgumentError`, potentially allowing the expectation to pass without even executing the method you are intending to call. Actual error raised was #<ArgumentError: wrong number of arguments (given 2, expected 1)>. Instead consider providing a specific error class or message. This message can be suppressed by setting: `RSpec::Expectations.configuration.on_potential_false_positives = :nothing`. Called from /var/tmp/portage/dev-ruby/safe_yaml-1.0.5-r1/work/ruby26/safe_yaml-1.0.5/spec/safe_yaml_spec.rb:362:in `block (5 levels) in <top (required)>'.
Comment 3 matoro archtester 2022-06-16 17:28:45 UTC
This has nothing to do with musl, it occurs on glibc on all arches and all Ruby versions.  I suspect this has something to do with psych instead of safe_yaml.
Comment 4 matoro archtester 2022-06-16 17:40:20 UTC
Got it.  Looks like this is an incompatibility with dev-ruby/psych:4.  Created an ebuild for the last version of psych 3, disabled the psych 4 gem specification, and it works.  However I'm not sure how to force it to use psych 3 since it seems to just pull in the latest psych version, which means it won't work if you have dev-ruby/psych:4 installed at all.

Additionally with these two Debian patches it also works on Ruby 3.x:

https://salsa.debian.org/ruby-team/ruby-safe-yaml/-/blob/master/debian/patches/fix_ruby_3_compatibility.patch
https://salsa.debian.org/ruby-team/ruby-safe-yaml/-/blob/master/debian/patches/adjust-tests-to-reflect-OpenStruct-changes-on-Ruby3.patch