summaryrefslogtreecommitdiff
path: root/lib/rubygems/platform.rb
diff options
context:
space:
mode:
authorLars Kanis <[email protected]>2021-06-25 10:07:18 +0200
committerNobuyoshi Nakada <[email protected]>2021-09-20 00:15:30 +0900
commit576b2e64cdc5ea42ad345dd3c1c215e006c06fca (patch)
treeb637da7146d4983b8084a8ee0776aa6a0b2030af /lib/rubygems/platform.rb
parent52cc54ce6f4258e4349c93d95c1ce111d26f8a7d (diff)
MINGW-UCRT: Set CONFIG['arch'] and RUBY_PLATFORM to "x64-mingw-ucrt"
This allows easy differentiation between ABI incompatible platforms like MSWIN64 and MSVCRT-based MINGW32. This also implicates a distinct rubygem platform which is also "x64-mingw-ucrt". Although the term "mingw32" is the OS-part for 64 bit systems as well, the "32" is misleading and confusing for many users. Therefore the new platform string drops the "32" from the OS part to just "mingw". This conforms to the common practice of windows platform testing per RUBY_PLATFORM=~/mswin|mingw/ .
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4599
Diffstat (limited to 'lib/rubygems/platform.rb')
-rw-r--r--lib/rubygems/platform.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/rubygems/platform.rb b/lib/rubygems/platform.rb
index 4b8ac31847..a5e65f9243 100644
--- a/lib/rubygems/platform.rb
+++ b/lib/rubygems/platform.rb
@@ -104,6 +104,7 @@ class Gem::Platform
when /^dotnet([\d.]*)/ then [ 'dotnet', $1 ]
when /linux-?((?!gnu)\w+)?/ then [ 'linux', $1 ]
when /mingw32/ then [ 'mingw32', nil ]
+ when /mingw-?(\w+)?/ then [ 'mingw', $1 ]
when /(mswin\d+)(\_(\d+))?/ then
os, version = $1, $3
@cpu = 'x86' if @cpu.nil? and os =~ /32$/