Skip to content

Commit

Permalink
Merge pull request #10319 from dcow/master
Browse files Browse the repository at this point in the history
install: add workaround for rosetta2 path error to msg
  • Loading branch information
MikeMcQuaid committed Jan 26, 2021
2 parents 703e34f + 786a06d commit 8a06a5e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Library/Homebrew/install.rb
Expand Up @@ -32,12 +32,16 @@ def perform_build_from_source_checks(all_fatal: false)
def check_prefix
if (Hardware::CPU.intel? || Hardware::CPU.in_rosetta2?) &&
HOMEBREW_PREFIX.to_s == HOMEBREW_MACOS_ARM_DEFAULT_PREFIX
configuration = if Hardware::CPU.in_rosetta2?
"under Rosetta 2"
if Hardware::CPU.in_rosetta2?
odie <<~EOS
Cannot install under Rosetta 2 in ARM default prefix (#{HOMEBREW_PREFIX})!
To rerun under ARM use:
arch -arm64 brew install ...
To install under x86_64, install Homebrew into #{HOMEBREW_DEFAULT_PREFIX}.
EOS
else
"on Intel processor"
odie "Cannot install on Intel processor in ARM default prefix (#{HOMEBREW_PREFIX})!"
end
odie "Cannot install in Homebrew #{configuration} in ARM default prefix (#{HOMEBREW_PREFIX})!"
elsif Hardware::CPU.arm? && HOMEBREW_PREFIX.to_s == HOMEBREW_DEFAULT_PREFIX
odie <<~EOS
Cannot install in Homebrew on ARM processor in Intel default prefix (#{HOMEBREW_PREFIX})!
Expand Down

0 comments on commit 8a06a5e

Please sign in to comment.