Description of problem: The load paths are duplicated on i386. Due to this duplication, one of ActiveSupport 3.0.9 test fails: 1) Failure: test_uniq_load_paths(LoadPathsTest) [./test/load_paths_test.rb:14:in `test_uniq_load_paths' /usr/lib/ruby/gems/1.8/gems/mocha-0.9.8/lib/mocha/integration/test_unit/ruby_version_186_and_above.rb:19:in `__send__' /usr/lib/ruby/gems/1.8/gems/mocha-0.9.8/lib/mocha/integration/test_unit/ruby_version_186_and_above.rb:19:in `run']: [["/usr/lib/ruby/1.8", 2], ["/usr/lib/ruby/site_ruby", 2], ["/usr/lib/ruby/site_ruby/1.8", 2]]. <false> is not true. This is the test code: require 'abstract_unit' class LoadPathsTest < Test::Unit::TestCase def test_uniq_load_paths load_paths_count = $LOAD_PATH.inject({}) { |paths, path| expanded_path = File.expand_path(path) paths[expanded_path] ||= 0 paths[expanded_path] += 1 paths } load_paths_count[File.expand_path('../../lib', __FILE__)] -= 1 filtered = load_paths_count.select { |k, v| v > 1 } assert filtered.empty?, filtered.inspect end end This is not issue for x86_64 Version-Release number of selected component (if applicable): > rpm -q ruby ruby-1.8.7.334-2.fc16.i686 > rpm -q ruby ruby-1.8.7.334-2.fc16.x86_64 How reproducible: Always Steps to Reproduce: 1. > ruby -v ruby 1.8.7 (2011-02-18 patchlevel 334) [x86_64-linux] > ruby -e "puts $:" /usr/lib/ruby/site_ruby/1.8 /usr/lib64/ruby/site_ruby/1.8 /usr/lib64/ruby/site_ruby/1.8/x86_64-linux /usr/lib/ruby/site_ruby /usr/lib64/ruby/site_ruby /usr/lib64/site_ruby/1.8 /usr/lib64/site_ruby/1.8/x86_64-linux /usr/lib64/site_ruby /usr/lib/ruby/1.8 /usr/lib64/ruby/1.8 /usr/lib64/ruby/1.8/x86_64-linux . 2. > ruby -v ruby 1.8.7 (2011-02-18 patchlevel 334) [i386-linux] > ruby -e "puts $:" /usr/lib/ruby/site_ruby/1.8 /usr/lib/ruby/site_ruby/1.8 /usr/lib/ruby/site_ruby/1.8/i386-linux /usr/lib/ruby/site_ruby /usr/lib/ruby/site_ruby /usr/lib/site_ruby/1.8 /usr/lib/site_ruby/1.8/i386-linux /usr/lib/site_ruby /usr/lib/ruby/1.8 /usr/lib/ruby/1.8 /usr/lib/ruby/1.8/i386-linux . Expected results: The paths in load path should not be duplicated
Any reason that mocha should raise error for this issue? (Well, it may be that there aren't any duplicate path, however I don't think raising error for this reason is preferable).
That is not mocha issue. If you'll take a look closer on my steps to reproduce, you will see that there are duplicated paths for i386. The reason is because on x86_64 the paths are duplicated to load libraries from both, lib and lib64 where on i386 the lib64 falls back to lib and that creates the duplicated entries.
(This is not ruby, however for example as root: # echo $PATH /usr/lib/qt-3.3/bin:/usr/lib/mpich2/bin:/usr//sbin:/usr//bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin So "duplicate path" is not ruby specific but somewhat common issue and we usually ignore this )
(In reply to comment #2) > That is not mocha issue. If you'll take a look closer on my steps to reproduce, > you will see that there are duplicated paths for i386. > > The reason is because on x86_64 the paths are duplicated to load libraries from > both, lib and lib64 where on i386 the lib64 falls back to lib and that creates > the duplicated entries. What I am saying is that I wonder there is any reason why mocha should complain and raise error for ruby that ruby has duplicate paths.
In other words, I wonder why duplicate paths on ruby really matters on mocha (although it may be that fixing this is preferable)
(In reply to comment #5) > In other words, I wonder why duplicate paths on ruby really matters on mocha > (although it may be that fixing this is preferable) Mocha is not complaining about anything. ActiveSupport test is complaining. Here [1] is the patch which introduces the test case. Unfortunately there is no other explanation. Since this problem is IMO introduced by ruby-1.8.7-lib-paths.patch patch, I would like to see it fixed in Fedora. [1] https://github.com/rails/rails/commit/4419497e403387a3cc93c4c1a3b6a07314a85e43
IMHO expecting no duplicate load path may be wrong assumption. though that may directly affects the performance to find libs out. so that should be better fixed, but it's another issue.
ruby-1.8.7.352-1.fc14 has been submitted as an update for Fedora 14. https://admin.fedoraproject.org/updates/ruby-1.8.7.352-1.fc14
ruby-1.8.7.352-1.fc15 has been submitted as an update for Fedora 15. https://admin.fedoraproject.org/updates/ruby-1.8.7.352-1.fc15
Package ruby-1.8.7.352-1.fc15: * should fix your issue, * was pushed to the Fedora 15 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing ruby-1.8.7.352-1.fc15' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/ruby-1.8.7.352-1.fc15 then log in and leave karma (feedback).
I did not tested it yet, but thank you for the fix anyway :)
ruby-1.8.7.352-1.fc14 has been pushed to the Fedora 14 stable repository. If problems still persist, please make note of it in this bug report.
ruby-1.8.7.352-1.fc15 has been pushed to the Fedora 15 stable repository. If problems still persist, please make note of it in this bug report.