Module: Homebrew::Install Private

Included in:
Homebrew
Defined in:
install.rb,
extend/os/linux/install.rb

Overview

This module is part of a private API. This module may only be used in the Homebrew/brew repository. Third parties should avoid using this module if possible, as it may be removed or changed without warning.

Helper module for performing (pre-)install checks.

Class Method Summary collapse

Class Method Details

.check_prefixObject

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'install.rb', line 32

def check_prefix
  if (Hardware::CPU.intel? || Hardware::CPU.in_rosetta2?) &&
     HOMEBREW_PREFIX.to_s == HOMEBREW_MACOS_ARM_DEFAULT_PREFIX
    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
      odie "Cannot install on Intel processor in ARM default prefix (#{HOMEBREW_PREFIX})!"
    end
  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})!
      Please create a new installation in #{HOMEBREW_MACOS_ARM_DEFAULT_PREFIX} using one of the
      "Alternative Installs" from:
        #{Formatter.url("https://docs.brew.sh/Installation")}
      You can migrate your previously installed formula list with:
        brew bundle dump
    EOS
  end
end

.perform_build_from_source_checks(all_fatal: false) ⇒ Object

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.



27
28
29
30
# File 'install.rb', line 27

def perform_build_from_source_checks(all_fatal: false)
  Diagnostic.checks(:fatal_build_from_source_checks)
  Diagnostic.checks(:build_from_source_checks, fatal: all_fatal)
end

.perform_preinstall_checks(all_fatal: false, cc: nil) ⇒ Object Also known as: generic_perform_preinstall_checks

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.



20
21
22
23
# File 'extend/os/linux/install.rb', line 20

def perform_preinstall_checks(all_fatal: false, cc: nil)
  generic_perform_preinstall_checks(all_fatal: all_fatal, cc: cc)
  symlink_ld_so
end