From b0de7b20160ba1910987c9165bc88689e6587c41 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 2 Dec 2020 17:16:50 -0600 Subject: [PATCH 1/3] Check for rosetta 2 support before installing --- scripts/install.in | 5 +++++ 1 file changed, 5 insertions(+) mode change 100644 => 100755 scripts/install.in diff --git a/scripts/install.in b/scripts/install.in old mode 100644 new mode 100755 index 7c3b795cc..46d3817b9 --- a/scripts/install.in +++ b/scripts/install.in @@ -46,6 +46,11 @@ case "$(uname -s).$(uname -m)" in system=x86_64-darwin ;; Darwin.arm64) + # check for Rosetta 2 support + if ! [ -d /Library/Apple/usr/libexec/oah ]; then + oops "Rosetta 2 is not installed on this ARM64 macOS machine. Run softwareupdate --install-rosetta then restart installation" + fi + hash=@binaryTarball_x86_64-darwin@ path=@tarballPath_x86_64-darwin@ # eventually maybe: arm64-darwin From addf9f4edeab8e8e2cb115dd98dc764cc1f19fcf Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 2 Dec 2020 19:05:02 -0600 Subject: [PATCH 2/3] Call it aarch64-darwin instead of arm64-darwin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gnu-config standardized on aarch64 for machine name so host_cpu part of $system will always be aarch64. That means system will be aarch64-darwin too. uname however could report either “aarch64” (if gnu coreutils) or “arm64” (if apple’s uname). We should support both for compatiblity here. --- scripts/install.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install.in b/scripts/install.in index 46d3817b9..9c8831d2b 100755 --- a/scripts/install.in +++ b/scripts/install.in @@ -45,7 +45,7 @@ case "$(uname -s).$(uname -m)" in path=@tarballPath_x86_64-darwin@ system=x86_64-darwin ;; - Darwin.arm64) + Darwin.arm64|Darwin.aarch64) # check for Rosetta 2 support if ! [ -d /Library/Apple/usr/libexec/oah ]; then oops "Rosetta 2 is not installed on this ARM64 macOS machine. Run softwareupdate --install-rosetta then restart installation" @@ -53,7 +53,7 @@ case "$(uname -s).$(uname -m)" in hash=@binaryTarball_x86_64-darwin@ path=@tarballPath_x86_64-darwin@ - # eventually maybe: arm64-darwin + # eventually maybe: aarch64-darwin system=x86_64-darwin ;; *) oops "sorry, there is no binary distribution of Nix for your platform";; From 692549c542f673015105a3aa4358c1e3095bb0e0 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Fri, 4 Dec 2020 13:28:09 -0600 Subject: [PATCH 3/3] Use com.apple.oahd.plist for rosetta 2 detection --- scripts/install.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install.in b/scripts/install.in index 9c8831d2b..0eaf25bb3 100755 --- a/scripts/install.in +++ b/scripts/install.in @@ -47,7 +47,7 @@ case "$(uname -s).$(uname -m)" in ;; Darwin.arm64|Darwin.aarch64) # check for Rosetta 2 support - if ! [ -d /Library/Apple/usr/libexec/oah ]; then + if ! [ -f /Library/Apple/System/Library/LaunchDaemons/com.apple.oahd.plist ]; then oops "Rosetta 2 is not installed on this ARM64 macOS machine. Run softwareupdate --install-rosetta then restart installation" fi