Bug 828002 - ruby package does not dep-in rubygem-bigdecimal
ruby package does not dep-in rubygem-bigdecimal
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: ruby (Show other bugs)
17
x86_64 Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Jeroen van Meeuwen
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-03 20:55 EDT by postmodern
Modified: 2012-06-15 06:33 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-15 05:53:53 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description postmodern 2012-06-03 20:55:24 EDT
Description of problem:

When installing the ruby package, it also installs rubygem-json and rubygem-io-console (which are normally part of the ruby stdlib). However, rubygem-bigdecimal is not installed, despite it being part of the ruby stdlib.  https://github.com/ruby/ruby/tree/436d819bf2f51b7e01aab070f92e8864793c8d16/ext/bigdecimal


Version-Release number of selected component (if applicable):

ruby-1.9.3.194 (10.1.fc17)
rubygem-bigdecimal-1.1.0 (10.1.fc17)

How reproducible: 

Steps to Reproduce:
1. yum install ruby ruby-irb rubygems
2. irb
3. require 'bigdecimal'
  
Actual results:

LoadError: cannot load such file -- bigdecimal
	from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
	from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
	from (irb):3
	from /usr/bin/irb:12:in `<main>'


Expected results:

bigdecimal is required.

Additional info:

RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.24
  - RUBY VERSION: 1.9.3 (2012-04-20 patchlevel 194) [x86_64-linux]
  - INSTALLATION DIRECTORY: /usr/local/share/gems
  - RUBY EXECUTABLE: /usr/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /usr/local/share/gems
     - /root/.gem/ruby/1.9.1
     - /usr/share/gems
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/
Comment 1 Bohuslav "Slavek" Kabrda 2012-06-04 04:54:38 EDT
bigdecimal Gem is one of the bundled Gems in new Ruby. We unbundled it and we now ship it as a separate package (rubygem-bigdecimal). As this Gem is not a hard dependency for Ruby itself (the only thing that requires it from the rest of Ruby is "/ext/psych/lib/psych/visitors/to_ruby.rb"), I would say that it's an optional dependency and doesn't have to be required by Ruby itself.

I am however leaving this bug open for more people from Ruby SIG to express their opinions.

BTW, these "fake gems" are showing more issues, that are even not Fedora specific. See [1] for the reports on Redmine.

[1] https://bugs.ruby-lang.org/issues/6124
Comment 2 postmodern 2012-06-04 05:11:12 EDT
Many RubyGems require bigdecimal [1], but do not define a dependency on the actual bigdecimal gem [2], thus expecting bigdecimal to be installed along with the Ruby stdlib.

[1]: https://github.com/search?q=%22require+%27bigdecimal%27%22&repo=&langOverride=&start_value=1&type=Code&language=Ruby
[2]: https://rubygems.org/gems/bigdecimal
Comment 3 postmodern 2012-06-04 05:24:12 EDT
BTW, these fake stdlib gems also confused the Bundler utility [1]. Although, I expect the Bundler developers will support /usr/share/gems soon. The ruby-core team eventually plans to gemify stdlib in Ruby 3.0 [2]. I like Fedora's approach to beginning the gemification of the Ruby stdlib.

[1]: https://github.com/carlhuda/bundler/issues/1960
[2]: http://bugs.ruby-lang.org/issues/5481
Comment 4 Vít Ondruch 2012-06-04 06:20:12 EDT
Hi postmodern,

I understand your sentiment and I can assure you that we are not happy about the situation. But we strive for correct solution. The only correct solution IMO is to gemify the stdlib correctly. If it will be gemified correctly, all the gems you mention should depend on bigdecimal. That is why are we trying to correct the situation with upstream, as mentioned by Slavek [1].



[1] https://bugs.ruby-lang.org/issues/6124
Comment 5 postmodern 2012-06-04 21:05:11 EDT
I've found a workaround to this issue. Simply add symlinks into /usr/share/ruby/ and /usr/lib/ruby/ to bigdecimal.

$ ln -s /usr/share/gems/gems/bigdecimal-1.1.0/lib/bigdecimal /usr/share/ruby/bigdecimal
$ ln -s /usr/lib/gems/exts/bigdecimal-1.1.0/lib/bigdecimal.so /usr/lib/ruby/bigdecimal.so

This allows Ruby projects that use Bundler to require bigdecimal, without explicitly depending on bigdecimal.

Perhaps rubygem-bigdecimal, rubygem-json, rubygem-io-console could add these symlinks for maximum backwards compatibility?
Comment 6 Vít Ondruch 2012-06-05 01:59:58 EDT
(In reply to comment #5)
> Perhaps rubygem-bigdecimal, rubygem-json, rubygem-io-console could add these
> symlinks for maximum backwards compatibility?

I am against this idea. Once you put these symlinks in place, you will never be able to correct this situation, since you will not be able to detect this issue.
Comment 7 Bohuslav "Slavek" Kabrda 2012-06-05 02:29:40 EDT
(In reply to comment #6)
> (In reply to comment #5)
> > Perhaps rubygem-bigdecimal, rubygem-json, rubygem-io-console could add these
> > symlinks for maximum backwards compatibility?
> 
> I am against this idea. Once you put these symlinks in place, you will never
> be able to correct this situation, since you will not be able to detect this
> issue.

Also, as already mentioned in [1], this prevents using newer versions of these gems, if they are not in Gemfile or gemspecs (therefore don't get picked up by rubygems loading mechanism). It is not the case for json, but it is the case for io-console and most importantly bigdecimal.

[1] https://bugs.ruby-lang.org/issues/6124
Comment 8 Bohuslav "Slavek" Kabrda 2012-06-15 05:53:53 EDT
The symlinks were added for bigdecimal and io-console in this update:

https://admin.fedoraproject.org/updates/FEDORA-2012-9264/ruby-1.9.3.194-13.fc17

Use 'sudo yum update ruby rubygem-bigdecimal rubygem-io-console --enablerepo=udpates-testing' to update.
Comment 9 postmodern 2012-06-15 06:33:18 EDT
Updated and my test-suites pass now. Thank you!

Note You need to log in before you can comment on or make changes to this bug.