From: Hiroshi NAKAMURA Date: 2011-05-18T17:43:19+09:00 Subject: [ruby-core:36311] [Ruby 1.9 - Bug #4255] When on a case-insensitive filesystem, "loaded features" search in require should ignore case Issue #4255 has been updated by Hiroshi NAKAMURA. > MRI ruby tests and rubyspec both rely on being able to change $". > Not sure how much of a circular justification that is. Yes, it is. Changing $" is OK. I meant that $".replace($".map(&:upcase)) does not work on case-insensitive FS as well as case-sensitive FS but I don't think these contrived examples helps us how to "fix" it. For 1.8, when we need to introduce huge perf regressions, Shyouhei would not fix this. ---------------------------------------- Bug #4255: When on a case-insensitive filesystem, "loaded features" search in require should ignore case http://redmine.ruby-lang.org/issues/4255 Author: Charles Nutter Status: Open Priority: Normal Assignee: Category: core Target version: ruby -v: Any version =begin This should not re-load the same library when running on a system with case-insensitive filenames: require 'blah' require 'BLAH' The resource in question has been loaded, and should not be reloaded again, even if it is attempted with a differing case. The above case seems contrived, but we have run into many real-world cases of this problem: * win32 APIs return paths with the drive name capitalized. Many libraries that manipulate load paths use lower-case drive names. (C: versus c:) * User code that adds load path entries at command-line or in script can easily differ in case * Typos in path names that introduce case differences will quietly work but cause double-requires. These may or may not be detected. A specific case in JRuby caused a series of files to be loaded twice, ultimately resulting in an alias chain looping back on itself (!!!). This is an extremely difficult case to debug, but very easy to reproduce. I propose that Ruby 1.9 (and ideally Ruby 1.8, since I consider this a bug and not a feature) should treat "loaded features" $" entries sourced from a case-insensitive filesystem with a case-insensitive comparison. =end -- http://redmine.ruby-lang.org