From f16163c144bce958b83c73c14bd8391843e08b2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Bu=CC=88nemann?= Date: Sun, 22 Nov 2020 00:43:03 +0100 Subject: [PATCH] Better check for Rosetta 2 This uses the syctl.proc_translated sysctl, which is the Apple documented way to check for Rosetta 2 environment. --- Library/Homebrew/extend/os/mac/hardware/cpu.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/extend/os/mac/hardware/cpu.rb b/Library/Homebrew/extend/os/mac/hardware/cpu.rb index 7b10da535a..ad84a72420 100644 --- a/Library/Homebrew/extend/os/mac/hardware/cpu.rb +++ b/Library/Homebrew/extend/os/mac/hardware/cpu.rb @@ -69,7 +69,7 @@ module Hardware # conflict between what `uname` reports and the underlying `sysctl` flags, # since the `sysctl` flags don't change behaviour under Rosetta 2. def in_rosetta2? - intel? && physical_cpu_arm64? + sysctl_bool("sysctl.proc_translated") end def features