From: Greg.mpls@... Date: 2018-05-21T04:07:48+00:00 Subject: [ruby-core:87207] [Ruby trunk Bug#14779] Windows - Casing issues - __FILE__, __dir__ Issue #14779 has been updated by MSP-Greg (Greg L). So RubyGems is comparing (via `==`) a known path (based on RbConfig info) and the location of a gemspec file. One character is a different case, which (as mentioned above) is the R in Ruby. I guess I'm missing something. The code generating the output shown above is contained in RbConfig.rb. Not being a c type, am I to assume that this is a Windows issue due to its case-insensitive file system? ---------------------------------------- Bug #14779: Windows - Casing issues - __FILE__, __dir__ https://bugs.ruby-lang.org/issues/14779#change-72197 * Author: MSP-Greg (Greg L) * Status: Rejected * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.6.0dev (2018-05-21 trunk 63473) [x64-mingw32] * Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN ---------------------------------------- For an unknown time, an informational Appveyor repo I have ([here](https://ci.appveyor.com/project/MSP-Greg/appveyor-ruby)) has shown default gems inconsistently. While doing some work in RubyGems, I came across the issue again. The issue went back to RbConfig, and the TOPDIR constant. I added the following lines to RbConfig.rb ``` puts "__dir__ #{__dir__}" puts "File.dirname(__FILE__) #{File.dirname(__FILE__)}" puts "Dir.pwd #{Dir.pwd}" ``` Testing with 2.4.4, 2.5.1, and trunk (`ruby 2.6.0dev (2018-05-21 trunk 63473) [x64-mingw32]`), in all instances, `Dir.pwd` returned the correct casing, but `__dir__` and `File.dirname(__FILE__)` did not. Below is console from the three versions: ``` C:\Greg\ruby24-x64>ruby -e "puts RUBY_DESCRIPTION" __dir__ C:/Greg/ruby26-x64/lib/ruby/2.6.0/x64-mingw32 File.dirname(__FILE__) C:/Greg/ruby26-x64/lib/ruby/2.6.0/x64-mingw32 Dir.pwd C:/Greg/ruby24-x64 ruby 2.6.0dev (2018-05-18 trunk 63464) [x64-mingw32] C:\Greg\ruby25-x64>ruby -e "puts RUBY_DESCRIPTION" __dir__ C:/Greg/Ruby25-x64/lib/ruby/2.5.0/x64-mingw32 File.dirname(__FILE__) C:/Greg/Ruby25-x64/lib/ruby/2.5.0/x64-mingw32 Dir.pwd C:/Greg/ruby25-x64 ruby 2.5.1p57 (2018-03-29 revision 63029) [x64-mingw32] C:\Greg\ruby26-x64>ruby -e "puts RUBY_DESCRIPTION" __dir__ C:/Greg/ruby26-x64/lib/ruby/2.6.0/x64-mingw32 File.dirname(__FILE__) C:/Greg/ruby26-x64/lib/ruby/2.6.0/x64-mingw32 Dir.pwd C:/Greg/ruby26-x64 ruby 2.6.0dev (2018-05-21 trunk 63473) [x64-mingw32] ``` From the above, I thought the issue was just with 2.5.1, but I then renamed the trunk folder, and had the following: ``` C:\Greg\ruby26-x64>cd .. C:\Greg>ren ruby26-x64 Ruby26-x64 C:\Greg>cd Ruby26-x64 C:\Greg\Ruby26-x64>ruby -e "puts RUBY_DESCRIPTION" __dir__ C:/Greg/ruby26-x64/lib/ruby/2.6.0/x64-mingw32 File.dirname(__FILE__) C:/Greg/ruby26-x64/lib/ruby/2.6.0/x64-mingw32 Dir.pwd C:/Greg/Ruby26-x64 ruby 2.6.0dev (2018-05-21 trunk 63473) [x64-mingw32] ``` So, the issue seems to also affect trunk. Thanks, Greg -- https://bugs.ruby-lang.org/ Unsubscribe: