Project

General

Profile

Actions

Bug #4255

closed

When on a case-insensitive filesystem, "loaded features" search in require should ignore case

Added by headius (Charles Nutter) over 13 years ago. Updated almost 13 years ago.

Status:
Rejected
Target version:
-
ruby -v:
-
Backport:
[ruby-core:34297]

Description

=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

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0