Merge pull request #19188 from Homebrew/arm64_linux-tag

Rename aarch64_linux tag to arm64_linux
This commit is contained in:
Mike McQuaid 2025-02-03 13:21:59 +00:00 committed by GitHub
commit 791194865f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 39 additions and 19 deletions

View File

@ -4,7 +4,7 @@
##### #####
case "${MACHTYPE}" in case "${MACHTYPE}" in
arm64-*) arm64-* | aarch64-*)
HOMEBREW_PROCESSOR="arm64" HOMEBREW_PROCESSOR="arm64"
;; ;;
x86_64-*) x86_64-*)

View File

@ -350,7 +350,7 @@ class GitHubPackages
tar_gz_sha256 = write_tar_gz(local_file, blobs) tar_gz_sha256 = write_tar_gz(local_file, blobs)
tab = tag_hash["tab"] tab = tag_hash["tab"]
architecture = TAB_ARCH_TO_PLATFORM_ARCHITECTURE[tab["arch"].presence || bottle_tag.arch.to_s] architecture = TAB_ARCH_TO_PLATFORM_ARCHITECTURE[tab["arch"].presence || bottle_tag.standardized_arch.to_s]
raise TypeError, "unknown tab['arch']: #{tab["arch"]}" if architecture.blank? raise TypeError, "unknown tab['arch']: #{tab["arch"]}" if architecture.blank?
os = if tab["built_on"].present? && tab["built_on"]["os"].present? os = if tab["built_on"].present? && tab["built_on"]["os"].present?

View File

@ -315,7 +315,7 @@ class Bottle
raise ArgumentError, "Invalid bottle version" unless Utils.safe_filename?(version.to_s) raise ArgumentError, "Invalid bottle version" unless Utils.safe_filename?(version.to_s)
@version = version @version = version
@tag = tag.to_s @tag = tag.to_unstandardized_sym.to_s
@rebuild = rebuild @rebuild = rebuild
end end

View File

@ -1024,6 +1024,11 @@ RSpec.describe Formula do
"intel-formula", "intel-formula",
"linux-formula" "linux-formula"
] ]
},
"arm64_linux": {
"dependencies": [
"linux-formula"
]
} }
} }
JSON JSON

View File

@ -79,11 +79,11 @@ RSpec.describe Utils::Bottles::Tag do
expect(tag.valid_combination?).to be true expect(tag.valid_combination?).to be true
end end
it "returns false for ARM on Linux" do it "returns true for ARM on Linux" do
tag = described_class.new(system: :linux, arch: :arm64) tag = described_class.new(system: :linux, arch: :arm64)
expect(tag.valid_combination?).to be false expect(tag.valid_combination?).to be true
tag = described_class.new(system: :linux, arch: :arm) tag = described_class.new(system: :linux, arch: :arm)
expect(tag.valid_combination?).to be false expect(tag.valid_combination?).to be true
end end
end end
end end

View File

@ -186,20 +186,14 @@ module Utils
sig { returns(Symbol) } sig { returns(Symbol) }
def standardized_arch def standardized_arch
return :x86_64 if [:x86_64, :intel].include? arch return :x86_64 if [:x86_64, :intel].include? arch
return :arm64 if [:arm64, :arm].include? arch return :arm64 if [:arm64, :arm, :aarch64].include? arch
arch arch
end end
sig { returns(Symbol) } sig { returns(Symbol) }
def to_sym def to_sym
if system == :all && arch == :all arch_to_symbol(standardized_arch)
:all
elsif macos? && [:x86_64, :intel].include?(arch)
system
else
:"#{standardized_arch}_#{system}"
end
end end
sig { returns(String) } sig { returns(String) }
@ -207,6 +201,14 @@ module Utils
to_sym.to_s to_sym.to_s
end end
def to_unstandardized_sym
# Never allow these generic names
return to_sym if [:intel, :arm].include? arch
# Backwards compatibility with older bottle names
arch_to_symbol(arch)
end
sig { returns(MacOSVersion) } sig { returns(MacOSVersion) }
def to_macos_version def to_macos_version
@to_macos_version ||= MacOSVersion.from_symbol(system) @to_macos_version ||= MacOSVersion.from_symbol(system)
@ -224,8 +226,8 @@ module Utils
sig { returns(T::Boolean) } sig { returns(T::Boolean) }
def valid_combination? def valid_combination?
return true unless [:arm64, :arm].include? arch return true unless [:arm64, :arm, :aarch64].include? arch
return false if linux? return true unless macos?
# Big Sur is the first version of macOS that runs on ARM # Big Sur is the first version of macOS that runs on ARM
to_macos_version >= :big_sur to_macos_version >= :big_sur
@ -235,7 +237,7 @@ module Utils
def default_prefix def default_prefix
if linux? if linux?
HOMEBREW_LINUX_DEFAULT_PREFIX HOMEBREW_LINUX_DEFAULT_PREFIX
elsif arch == :arm64 elsif standardized_arch == :arm64
HOMEBREW_MACOS_ARM_DEFAULT_PREFIX HOMEBREW_MACOS_ARM_DEFAULT_PREFIX
else else
HOMEBREW_DEFAULT_PREFIX HOMEBREW_DEFAULT_PREFIX
@ -246,12 +248,25 @@ module Utils
def default_cellar def default_cellar
if linux? if linux?
Homebrew::DEFAULT_LINUX_CELLAR Homebrew::DEFAULT_LINUX_CELLAR
elsif arch == :arm64 elsif standardized_arch == :arm64
Homebrew::DEFAULT_MACOS_ARM_CELLAR Homebrew::DEFAULT_MACOS_ARM_CELLAR
else else
Homebrew::DEFAULT_MACOS_CELLAR Homebrew::DEFAULT_MACOS_CELLAR
end end
end end
private
sig { params(arch: Symbol).returns(Symbol) }
def arch_to_symbol(arch)
if system == :all && arch == :all
:all
elsif macos? && standardized_arch == :x86_64
system
else
:"#{arch}_#{system}"
end
end
end end
# The specification for a specific tag # The specification for a specific tag

View File

@ -77,7 +77,7 @@ To install build tools, paste at a terminal prompt:
### ARM (unsupported) ### ARM (unsupported)
Homebrew can run on 32-bit ARM (Raspberry Pi and others) and 64-bit ARM (AArch64), but as they lack binary packages (bottles) they are unsupported. Pull requests are welcome to improve the experience on ARM platforms. Homebrew can run on 32-bit ARM (e.g. Raspberry Pi and others) and 64-bit ARM (ARM64, also known as AArch64), but as they lack bottles (binary packages) they are unsupported. Pull requests are welcome to improve the experience on ARM platforms.
You may need to install your own Ruby using your system package manager, a PPA, or `rbenv/ruby-build` as we no longer distribute a Homebrew Portable Ruby for ARM. You may need to install your own Ruby using your system package manager, a PPA, or `rbenv/ruby-build` as we no longer distribute a Homebrew Portable Ruby for ARM.