install: clarify "on Intel" error if under Rosetta 2.
Inspired by https://github.com/Homebrew/brew/issues/10088
This commit is contained in:
parent
2c4aea93cd
commit
fe8f3c4b13
@ -30,8 +30,14 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
def check_prefix
|
def check_prefix
|
||||||
if Hardware::CPU.intel? && HOMEBREW_PREFIX.to_s == HOMEBREW_MACOS_ARM_DEFAULT_PREFIX
|
if (Hardware::CPU.intel? || Hardware::CPU.in_rosetta2?) &&
|
||||||
odie "Cannot install in Homebrew on Intel processor in ARM default prefix (#{HOMEBREW_PREFIX})!"
|
HOMEBREW_PREFIX.to_s == HOMEBREW_MACOS_ARM_DEFAULT_PREFIX
|
||||||
|
configuration = if Hardware::CPU.in_rosetta2?
|
||||||
|
"on Intel processor"
|
||||||
|
else
|
||||||
|
"under Rosetta 2"
|
||||||
|
end
|
||||||
|
odie "Cannot install in Homebrew #{configuration} in ARM default prefix (#{HOMEBREW_PREFIX})!"
|
||||||
elsif Hardware::CPU.arm? && HOMEBREW_PREFIX.to_s == HOMEBREW_DEFAULT_PREFIX
|
elsif Hardware::CPU.arm? && HOMEBREW_PREFIX.to_s == HOMEBREW_DEFAULT_PREFIX
|
||||||
odie <<~EOS
|
odie <<~EOS
|
||||||
Cannot install in Homebrew on ARM processor in Intel default prefix (#{HOMEBREW_PREFIX})!
|
Cannot install in Homebrew on ARM processor in Intel default prefix (#{HOMEBREW_PREFIX})!
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user