Merge pull request #9443 from MikeMcQuaid/arm64_big_sur_bottle_ordering

Fix `:arm64_big_sur` bottle ordering.
This commit is contained in:
Mike McQuaid 2020-12-07 12:37:41 +00:00 committed by GitHub
commit 62de53a515
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -11,6 +11,14 @@ module Hardware
INTEL_64BIT_ARCHS = [:x86_64].freeze
PPC_32BIT_ARCHS = [:ppc, :ppc32, :ppc7400, :ppc7450, :ppc970].freeze
PPC_64BIT_ARCHS = [:ppc64, :ppc64le, :ppc970].freeze
ARM_64BIT_ARCHS = [:arm64].freeze
ALL_ARCHS = [
*INTEL_32BIT_ARCHS,
*INTEL_64BIT_ARCHS,
*PPC_32BIT_ARCHS,
*PPC_64BIT_ARCHS,
*ARM_64BIT_ARCHS,
].freeze
class << self
extend T::Sig

View File

@ -25,7 +25,11 @@ module OS
sig { params(sym: Symbol).returns(T.attached_class) }
def self.from_symbol(sym)
str = SYMBOLS.fetch(sym) { raise MacOSVersionError, sym }
@all_archs_regex ||= /^#{Regexp.union(Hardware::CPU::ALL_ARCHS.map(&:to_s))}_/
sym_without_arch = sym.to_s
.sub(@all_archs_regex, "")
.to_sym
str = SYMBOLS.fetch(sym_without_arch) { raise MacOSVersionError, sym }
new(str)
end