From: "headius (Charles Nutter)" Date: 2013-03-16T02:01:29+09:00 Subject: [ruby-core:53446] [ruby-trunk - Feature #8090] resolv.rb checks platform based on RUBY_PLATFORM, which is insufficient for JRuby Issue #8090 has been updated by headius (Charles Nutter). I thought host_os is the OS that we're *actually* running on, and target_os was the OS name Ruby was built for. Was I mistaken? I like checking RbConfig::CONFIG alone, if we can decide which key to use. ---------------------------------------- Feature #8090: resolv.rb checks platform based on RUBY_PLATFORM, which is insufficient for JRuby https://bugs.ruby-lang.org/issues/8090#change-37630 Author: headius (Charles Nutter) Status: Open Priority: Normal Assignee: Category: lib Target version: next minor JRuby shares stdlib with MRI, and as a result we've had to patch a number of things. We'd like to get some of these changes back into MRI's copy. This issue refers to the following check in resolv.rb: if /mswin|mingw|bccwin/ =~ RUBY_PLATFORM require 'win32/resolv' DefaultFileName = Win32::Resolv.get_hosts_path else DefaultFileName = '/etc/hosts' end Because RUBY_PLATFORM on JRuby is always 'java', this check will use the incorrect "hosts" path on Windows. This was reported as an issue in https://github.com/jruby/jruby/issues/580. We had patched 1.8 stdlib but not 1.9 stdlib to use the following line for checking platform: if /mswin|mingw|bccwin/ =~ RUBY_PLATFORM || ::RbConfig::CONFIG['host_os'] =~ /mswin/ I would like to commit this change back to MRI for 1.9.3, 2.0, and 2.1. It does not produce a behavioral change on MRI, since there's no supported platforms that will match /mswin/ for host_os, but it means we won't have to maintain a diff. -- http://bugs.ruby-lang.org/