Skip to content
  • Carlo Cabrera's avatar
    vendor-install: handle native ARM running under Rosetta · 8aeb2878
    Carlo Cabrera authored
    Since `HOMEBREW_PROCESSOR` is populated using `uname -m`, this will
    register as `Intel` even when a native ARM install is running under
    Rosetta.
    
    Let's work around this by checking `sysctl -n machdep.cpu.brand_string`.
    On my Intel machine:
    
        ❯ sysctl -n machdep.cpu.brand_string
        Intel(R) Core(TM) i3-1000NG4 CPU @ 1.10GHz
    
    On Apple Silicon:
    
        brew@HMBRW-A-001-M1-001 ~ % sysctl -n machdep.cpu.brand_string
        Apple M1
    
    The case of a Rosetta installation of Homebrew is already handled below
    the proposed change.
    
    Fixes Homebrew/discussions#2434.
    8aeb2878