ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:37805] [Ruby 1.8 - Bug #4979][Open] `require 'foo'` is ambiguous when there is both foo.rb and foo.so
@ 2011-07-05 18:29 Antonio Terceiro
  2011-07-08 16:04 ` [ruby-core:37889] [Ruby 1.8 - Feature #4979] " Antonio Terceiro
  2011-07-09 17:42 ` [ruby-core:37929] [Ruby 1.8 - Feature #4979][Rejected] " Yui NARUSE
  0 siblings, 2 replies; 4+ messages in thread
From: Antonio Terceiro @ 2011-07-05 18:29 UTC (permalink / raw
  To: ruby-core


Issue #4979 has been reported by Antonio Terceiro.

----------------------------------------
Bug #4979: `require 'foo'` is ambiguous when there is both foo.rb and foo.so
http://redmine.ruby-lang.org/issues/4979

Author: Antonio Terceiro
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 
ruby -v: ruby 1.8.7 (2011-06-30 patchlevel 352) [i486-linux]


=begin

When there is both foo.rb and foo.so and a `require 'foo'` call is evaluated, Ruby 1.8 will load either foo.rb or foo.so depending on which order their directories are in $LOAD_PATH.

Ruby 1.8 will load the first foo.rb or foo.so it finds in the $LOAD_PATH.

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.

I have attached a test case that shows these different behaviours of Ruby 1.8 and Ruby 1.9.

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.

=end



-- 
http://redmine.ruby-lang.org

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-core:37889] [Ruby 1.8 - Feature #4979] `require 'foo'` is ambiguous when there is both foo.rb and foo.so
  2011-07-05 18:29 [ruby-core:37805] [Ruby 1.8 - Bug #4979][Open] `require 'foo'` is ambiguous when there is both foo.rb and foo.so Antonio Terceiro
@ 2011-07-08 16:04 ` Antonio Terceiro
  2011-07-08 17:40   ` [ruby-core:37898] " Aaron Patterson
  2011-07-09 17:42 ` [ruby-core:37929] [Ruby 1.8 - Feature #4979][Rejected] " Yui NARUSE
  1 sibling, 1 reply; 4+ messages in thread
From: Antonio Terceiro @ 2011-07-08 16:04 UTC (permalink / raw
  To: ruby-core


Issue #4979 has been updated by Antonio Terceiro.


What is needed to have a decision?
----------------------------------------
Feature #4979: `require 'foo'` is ambiguous when there is both foo.rb and foo.so
http://redmine.ruby-lang.org/issues/4979

Author: Antonio Terceiro
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 


=begin

When there is both foo.rb and foo.so and a `require 'foo'` call is evaluated, Ruby 1.8 will load either foo.rb or foo.so depending on which order their directories are in $LOAD_PATH.

Ruby 1.8 will load the first foo.rb or foo.so it finds in the $LOAD_PATH.

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.

I have attached a test case that shows these different behaviours of Ruby 1.8 and Ruby 1.9.

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.

=end



-- 
http://redmine.ruby-lang.org

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-core:37898] Re: [Ruby 1.8 - Feature #4979] `require 'foo'` is ambiguous when there is both foo.rb and foo.so
  2011-07-08 16:04 ` [ruby-core:37889] [Ruby 1.8 - Feature #4979] " Antonio Terceiro
@ 2011-07-08 17:40   ` Aaron Patterson
  0 siblings, 0 replies; 4+ messages in thread
From: Aaron Patterson @ 2011-07-08 17:40 UTC (permalink / raw
  To: ruby-core

[-- Attachment #1: Type: text/plain, Size: 1485 bytes --]

On Sat, Jul 09, 2011 at 01:04:08AM +0900, Antonio Terceiro wrote:
> When there is both foo.rb and foo.so and a `require 'foo'` call is evaluated, Ruby 1.8 will load either foo.rb or foo.so depending on which order their directories are in $LOAD_PATH.
> 
> Ruby 1.8 will load the first foo.rb or foo.so it finds in the $LOAD_PATH.
> 
> 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.
> 
> I have attached a test case that shows these different behaviours of Ruby 1.8 and Ruby 1.9.
> 
> 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.

Making this change would break 1.8 users that depend on this behavior.
Users may *unknowingly* depend on this behavior.  Imagine someone's pain
that makes what *seems* like a safe upgrade (say 1.8.7-p1 to 1.8.7-p2),
and boom, my application stops working because of require behavior
change.

Contrast that with upgrading to 1.9, where the user *knows* some
behaviors of Ruby may have changed.

This isn't a bug, it's a behavior.  Leave 1.8 as is.  Let users upgrade to 1.9.

-- 
Aaron Patterson
http://tenderlovemaking.com/

[-- Attachment #2: Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-core:37929] [Ruby 1.8 - Feature #4979][Rejected] `require 'foo'` is ambiguous when there is both foo.rb and foo.so
  2011-07-05 18:29 [ruby-core:37805] [Ruby 1.8 - Bug #4979][Open] `require 'foo'` is ambiguous when there is both foo.rb and foo.so Antonio Terceiro
  2011-07-08 16:04 ` [ruby-core:37889] [Ruby 1.8 - Feature #4979] " Antonio Terceiro
@ 2011-07-09 17:42 ` Yui NARUSE
  1 sibling, 0 replies; 4+ messages in thread
From: Yui NARUSE @ 2011-07-09 17:42 UTC (permalink / raw
  To: ruby-core


Issue #4979 has been updated by Yui NARUSE.

Status changed from Open to Rejected

Ruby 1.8 won't change any more except bugs.
----------------------------------------
Feature #4979: `require 'foo'` is ambiguous when there is both foo.rb and foo.so
http://redmine.ruby-lang.org/issues/4979

Author: Antonio Terceiro
Status: Rejected
Priority: Normal
Assignee: 
Category: 
Target version: 


=begin

When there is both foo.rb and foo.so and a `require 'foo'` call is evaluated, Ruby 1.8 will load either foo.rb or foo.so depending on which order their directories are in $LOAD_PATH.

Ruby 1.8 will load the first foo.rb or foo.so it finds in the $LOAD_PATH.

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.

I have attached a test case that shows these different behaviours of Ruby 1.8 and Ruby 1.9.

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.

=end



-- 
http://redmine.ruby-lang.org

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-07-09 17:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-05 18:29 [ruby-core:37805] [Ruby 1.8 - Bug #4979][Open] `require 'foo'` is ambiguous when there is both foo.rb and foo.so Antonio Terceiro
2011-07-08 16:04 ` [ruby-core:37889] [Ruby 1.8 - Feature #4979] " Antonio Terceiro
2011-07-08 17:40   ` [ruby-core:37898] " Aaron Patterson
2011-07-09 17:42 ` [ruby-core:37929] [Ruby 1.8 - Feature #4979][Rejected] " Yui NARUSE

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).