Bug 2223700

Summary: ruby:3.1/rubygem-irb: IRB has hard dependency on rubygem-rdoc [RHEL 8]
Product: Red Hat Enterprise Linux 8 Reporter: Jarek Prokop <jprokop>
Component: rubyAssignee: ruby maint <ruby-maint>
Status: NEW --- QA Contact: RHEL CS Apps Subsystem QE <rhel-cs-apps-subsystem-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.9   
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2223704 (view as bug list) Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jarek Prokop 2023-07-18 14:23:09 UTC
Description of problem:
The IRB console throws error when run without rubygem-rdoc installed.

This is not correct, rubygem IRB should not have a hard dependency on RDoc.

Version-Release number of selected component (if applicable):
rubygem-irb-1.4.1-141.module+el8.7.0+15051+29b42f0c

How reproducible:
always

Steps to Reproduce:
1. dnf module enable ruby:3.1-y
2. dnf --setopt=install_weak_deps=False install -y rubygem-irb
(rubygem-rdoc gets pulled in via weak dependencies by default.)
3. echo '' | irb
(  ^ this allows for automated running in e.g. scripts.)

Actual results:
~~~
$ echo '' | irb
<internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- rdoc (LoadError)
	from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from /usr/share/gems/gems/irb-1.4.1/lib/irb/input-method.rb:17:in `<top (required)>'
	from /usr/share/gems/gems/irb-1.4.1/lib/irb/context.rb:14:in `require_relative'
	from /usr/share/gems/gems/irb-1.4.1/lib/irb/context.rb:14:in `<top (required)>'
	from /usr/share/gems/gems/irb-1.4.1/lib/irb.rb:16:in `require_relative'
	from /usr/share/gems/gems/irb-1.4.1/lib/irb.rb:16:in `<top (required)>'
	from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from /usr/share/gems/gems/irb-1.4.1/exe/irb:9:in `<top (required)>'
	from /usr/bin/irb:25:in `load'
	from /usr/bin/irb:25:in `<main>'
~~~

Expected results:
No error
~~~
$ echo '' | irb
Switch to inspect mode.


~~~

Additional info:
Reported upstream some while back https://github.com/ruby/irb/issues/342
Upstream resolved via:
https://github.com/ruby/irb/commit/54c8df06ff9e161012f89d19a4e3aa2e0e37e1b0
https://github.com/ruby/irb/commit/b24852058fc87c940252c8a711c60ae2eb298082

Fedora's Ruby 3.1 fixed it via these commit that include upstream changes to drop the hard dependency inside IRB:
https://src.fedoraproject.org/rpms/ruby/c/3f106c188ea6368c950ba7d610594f910773a25f?branch=f37
https://src.fedoraproject.org/rpms/ruby/c/bf921512e288965724353ecf73ca9aa6d4975489?branch=f37