https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112011-07-06T07:34:34ZRuby Issue Tracking SystemRuby 1.8 - Feature #4979: `require 'foo'` is ambiguous when there is both foo.rb and foo.sohttps://bugs.ruby-lang.org/issues/4979?journal_id=188552011-07-06T07:34:34Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>Tracker</strong> changed from <i>Bug</i> to <i>Feature</i></li></ul><p>Obviously this is a spec change request.</p> Ruby 1.8 - Feature #4979: `require 'foo'` is ambiguous when there is both foo.rb and foo.sohttps://bugs.ruby-lang.org/issues/4979?journal_id=189472011-07-09T01:04:07Zterceiro (Antonio Terceiro)asa@terceiro.xyz
<ul></ul><p>What is needed to have a decision?</p> Ruby 1.8 - Feature #4979: `require 'foo'` is ambiguous when there is both foo.rb and foo.sohttps://bugs.ruby-lang.org/issues/4979?journal_id=189552011-07-09T02:53:07Ztenderlovemaking (Aaron Patterson)tenderlove@ruby-lang.org
<ul></ul><p>On Sat, Jul 09, 2011 at 01:04:08AM +0900, Antonio Terceiro wrote:</p>
<blockquote>
<p>When there is both foo.rb and foo.so and a <code>require 'foo'</code> call is evaluated, Ruby 1.8 will load either foo.rb or foo.so depending on which order their directories are in $LOAD_PATH.</p>
<p>Ruby 1.8 will load the first foo.rb or foo.so it finds in the $LOAD_PATH.</p>
<p>Ruby 1.9 will first look for foo.rb in all directories, and only after that it will look for foo.so in all directories. This behaviour seems more consistent than the one in Ruby 1.8. It also matches the most common use case, which is foo.rb loading its sister foo.so that contains native-code implementations needed by foo.rb.</p>
<p>I have attached a test case that shows these different behaviours of Ruby 1.8 and Ruby 1.9.</p>
<p>I propose to make Ruby 1.8 work the same way as Ruby 1.9. If there is consensus about that, I can try to write a patch to backport the behaviour of Ruby 1.9 for Ruby 1.8.</p>
</blockquote>
<p>Making this change would break 1.8 users that depend on this behavior.<br>
Users may <em>unknowingly</em> depend on this behavior. Imagine someone's pain<br>
that makes what <em>seems</em> like a safe upgrade (say 1.8.7-p1 to 1.8.7-p2),<br>
and boom, my application stops working because of require behavior<br>
change.</p>
<p>Contrast that with upgrading to 1.9, where the user <em>knows</em> some<br>
behaviors of Ruby may have changed.</p>
<p>This isn't a bug, it's a behavior. Leave 1.8 as is. Let users upgrade to 1.9.</p>
<p>--<br>
Aaron Patterson<br>
<a href="http://tenderlovemaking.com/" class="external">http://tenderlovemaking.com/</a></p> Ruby 1.8 - Feature #4979: `require 'foo'` is ambiguous when there is both foo.rb and foo.sohttps://bugs.ruby-lang.org/issues/4979?journal_id=189852011-07-10T02:42:56Znaruse (Yui NARUSE)naruse@airemix.jp
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Rejected</i></li></ul><p>Ruby 1.8 won't change any more except bugs.</p>