Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-5613

ruby:3.1/rubygem-irb: IRB has hard dependency on rubygem-rdoc [RHEL 9]

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Undefined Undefined
    • rhel-9.5
    • rhel-9.4
    • ruby
    • ruby-3.1-9050020240320125800.9
    • None
    • None
    • ZStream
    • sst_cs_apps
    • ssg_core_services
    • 4
    • 15
    • 3
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • Approved Blocker
    • None
    • None
    • If docs needed, set a value
    • None

      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+el9.1.0+15737+76195479

      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

            jprokop@redhat.com Jarek Prokop
            jprokop@redhat.com Jarek Prokop
            ruby-maint ruby-maint
            Lukas Zachar Lukas Zachar
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: