[ruby-core:113632] [Ruby master Bug#19691] Case insensitive file systems, require filename casing

Issue #19691 has been reported by MSP-Greg (Greg L). ---------------------------------------- Bug #19691: Case insensitive file systems, require filename casing https://bugs.ruby-lang.org/issues/19691 * Author: MSP-Greg (Greg L) * Status: Open * Priority: Normal * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- I don't know what I think of this (expected or bug), but recently in a forum I saw an issue that I don't recall accidentally doing myself. An equivalent example: ``` ruby -rsingleton -rSingleton -e "puts 'case issue'" ``` Note the change of casing with `Singleton`. On case insensitive file systems, the above will double load the file, which errors. Obviously, on case sensitive file systems, it errors with `cannot load such file -- Singleton` So, options are: A. No change to current behavior, which I'm fine with. B. If the OS is case insensitive, don't reload the file, and maybe a warning that `Singleton` and `singleton` are equivalent. -- https://bugs.ruby-lang.org/

Issue #19691 has been updated by MSP-Greg (Greg L). Sorry, accidentally used the default 'Tracker type', which is 'Bug'. Meant to post it as 'Misc' ---------------------------------------- Bug #19691: Case insensitive file systems, require filename casing https://bugs.ruby-lang.org/issues/19691#change-103273 * Author: MSP-Greg (Greg L) * Status: Open * Priority: Normal * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- I don't know what I think of this (expected or bug), but recently in a forum I saw an issue that I don't recall accidentally doing myself. An equivalent example: ``` ruby -rsingleton -rSingleton -e "puts 'case issue'" ``` Note the change of casing with `Singleton`. On case insensitive file systems, the above will double load the file, which errors. Obviously, on case sensitive file systems, it errors with `cannot load such file -- Singleton` So, options are: A. No change to current behavior, which I'm fine with. B. If the OS is case insensitive, don't reload the file, and maybe a warning that `Singleton` and `singleton` are equivalent. -- https://bugs.ruby-lang.org/

Issue #19691 has been updated by nobu (Nobuyoshi Nakada). Tracker changed from Bug to Misc Status changed from Open to Feedback Backport deleted (3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN) I think it has changed since 3.1. ```shell-session $ ruby3.0 -v -W0 -rsingleton -rSingleton -e 'p $"[-2..-1]' ruby 3.0.6p216 (2023-03-30 revision 23a532679b) [x86_64-darwin22] /opt/local/lib/ruby/3.0.0/Singleton.rb:152:in `undef_method': undefined method `extend_object' for class `Singleton' (NameError) Did you mean? extended from /opt/local/lib/ruby/3.0.0/Singleton.rb:152:in `singleton class' from /opt/local/lib/ruby/3.0.0/Singleton.rb:140:in `<module:Singleton>' from /opt/local/lib/ruby/3.0.0/Singleton.rb:94:in `<top (required)>' from <internal:/opt/local/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require' from <internal:/opt/local/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require' bash: exit 1 $ ruby3.1 -v -rsingleton -rSingleton -e 'p $"[-2..-1]' ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-darwin22] ["/opt/local/lib/ruby/3.1.0/did_you_mean.rb", "/opt/local/lib/ruby/3.1.0/singleton.rb"] ``` ---------------------------------------- Misc #19691: Case insensitive file systems, require filename casing https://bugs.ruby-lang.org/issues/19691#change-103274 * Author: MSP-Greg (Greg L) * Status: Feedback * Priority: Normal ---------------------------------------- I don't know what I think of this (expected or bug), but recently in a forum I saw an issue that I don't recall accidentally doing myself. An equivalent example: ``` ruby -rsingleton -rSingleton -e "puts 'case issue'" ``` Note the change of casing with `Singleton`. On case insensitive file systems, the above will double load the file, which errors. Obviously, on case sensitive file systems, it errors with `cannot load such file -- Singleton` So, options are: A. No change to current behavior, which I'm fine with. B. If the OS is case insensitive, don't reload the file, and maybe a warning that `Singleton` and `singleton` are equivalent. -- https://bugs.ruby-lang.org/

Issue #19691 has been updated by jeremyevans0 (Jeremy Evans). Subject changed from Case insensitive file systems, require filename casing to File.realpath on Windows does not return actual case of the file Status changed from Feedback to Open Looks like #17885 fixed the issue for case-insensitive Mac OS file systems. However, it is not fixed on Windows because `File.realpath` on Windows doesn't fix the case: ```ruby File.realpath('a') # => "C:/Users/jeremye/a" File.realpath('A') # => "C:/Users/jeremye/A" ``` Not sure if that is considered a bug in `File.realpath`, but it would be nice if `File.realpath` returned the actual case of the file. ---------------------------------------- Misc #19691: File.realpath on Windows does not return actual case of the file https://bugs.ruby-lang.org/issues/19691#change-103279 * Author: MSP-Greg (Greg L) * Status: Open * Priority: Normal ---------------------------------------- I don't know what I think of this (expected or bug), but recently in a forum I saw an issue that I don't recall accidentally doing myself. An equivalent example: ``` ruby -rsingleton -rSingleton -e "puts 'case issue'" ``` Note the change of casing with `Singleton`. On case insensitive file systems, the above will double load the file, which errors. Obviously, on case sensitive file systems, it errors with `cannot load such file -- Singleton` So, options are: A. No change to current behavior, which I'm fine with. B. If the OS is case insensitive, don't reload the file, and maybe a warning that `Singleton` and `singleton` are equivalent. -- https://bugs.ruby-lang.org/

Issue #19691 has been updated by MSP-Greg (Greg L). @nobu Thanks. Using the following Windows Rubies, I get different results. All double load and throw `NameError`: ``` ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x64-mingw-ucrt] ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x64-mingw-ucrt] ruby 3.3.0dev (2023-05-24T13:45:34Z master 6d976eb534) [x64-mingw-ucrt] ruby 3.3.0dev (2023-05-24T13:45:34Z master 6d976eb534) [x64-mswin64_140] ``` ---------------------------------------- Misc #19691: File.realpath on Windows does not return actual case of the file https://bugs.ruby-lang.org/issues/19691#change-103280 * Author: MSP-Greg (Greg L) * Status: Open * Priority: Normal ---------------------------------------- I don't know what I think of this (expected or bug), but recently in a forum I saw an issue that I don't recall accidentally doing myself. An equivalent example: ``` ruby -rsingleton -rSingleton -e "puts 'case issue'" ``` Note the change of casing with `Singleton`. On case insensitive file systems, the above will double load the file, which errors. Obviously, on case sensitive file systems, it errors with `cannot load such file -- Singleton` So, options are: A. No change to current behavior, which I'm fine with. B. If the OS is case insensitive, don't reload the file, and maybe a warning that `Singleton` and `singleton` are equivalent. -- https://bugs.ruby-lang.org/

Issue #19691 has been updated by MSP-Greg (Greg L). @jeremyevans0 Thanks. I hadn't looked yet. JFYI, `File.absolute_path` does seem to work correctly. ``` # file name is Greg.txt puts File.absolute_path 'C:/tmpdir/greg.txt' #=> C:/tmpdir/Greg.txt # file name is ggreg.txt puts File.absolute_path 'C:/tmpdir/GGreg.txt' #=> C:/tmpdir/ggreg.txt ``` ``` ---------------------------------------- Misc #19691: File.realpath on Windows does not return actual case of the file https://bugs.ruby-lang.org/issues/19691#change-103281 * Author: MSP-Greg (Greg L) * Status: Open * Priority: Normal ---------------------------------------- I don't know what I think of this (expected or bug), but recently in a forum I saw an issue that I don't recall accidentally doing myself. An equivalent example: ``` ruby -rsingleton -rSingleton -e "puts 'case issue'" ``` Note the change of casing with `Singleton`. On case insensitive file systems, the above will double load the file, which errors. Obviously, on case sensitive file systems, it errors with `cannot load such file -- Singleton` So, options are: A. No change to current behavior, which I'm fine with. B. If the OS is case insensitive, don't reload the file, and maybe a warning that `Singleton` and `singleton` are equivalent. -- https://bugs.ruby-lang.org/

Issue #19691 has been updated by nobu (Nobuyoshi Nakada). `File.absolute_path` and `File.expand_path` normalize a short path to the long path, and the case too (maybe as a side effect). ---------------------------------------- Misc #19691: File.realpath on Windows does not return actual case of the file https://bugs.ruby-lang.org/issues/19691#change-103336 * Author: MSP-Greg (Greg L) * Status: Open * Priority: Normal ---------------------------------------- I don't know what I think of this (expected or bug), but recently in a forum I saw an issue that I don't recall accidentally doing myself. An equivalent example: ``` ruby -rsingleton -rSingleton -e "puts 'case issue'" ``` Note the change of casing with `Singleton`. On case insensitive file systems, the above will double load the file, which errors. Obviously, on case sensitive file systems, it errors with `cannot load such file -- Singleton` So, options are: A. No change to current behavior, which I'm fine with. B. If the OS is case insensitive, don't reload the file, and maybe a warning that `Singleton` and `singleton` are equivalent. -- https://bugs.ruby-lang.org/
participants (3)
-
jeremyevans0 (Jeremy Evans)
-
MSP-Greg (Greg L)
-
nobu (Nobuyoshi Nakada)