From a9d122dcd8d3011f9f8174a775d7a85e00848145 Mon Sep 17 00:00:00 2001 From: yvt Date: Fri, 15 Oct 2021 09:48:15 +0900 Subject: [PATCH 1/2] Add another path where a Rosetta 2 configuration file is possibly located (cherry picked from commit a9d9e5555118025032eabd9612e03473a97ebff8) --- src/libstore/globals.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc index 6934801e3da..4903d0922e7 100644 --- a/src/libstore/globals.cc +++ b/src/libstore/globals.cc @@ -148,7 +148,8 @@ StringSet Settings::getDefaultExtraPlatforms() // machines. Note that we can’t force processes from executing // x86_64 in aarch64 environments or vice versa since they can // always exec with their own binary preferences. - if (pathExists("/Library/Apple/System/Library/LaunchDaemons/com.apple.oahd.plist")) { + if (pathExists("/Library/Apple/System/Library/LaunchDaemons/com.apple.oahd.plist") || + pathExists("/System/Library/LaunchDaemons/com.apple.oahd.plist")) { if (std::string{SYSTEM} == "x86_64-darwin") extraPlatforms.insert("aarch64-darwin"); else if (std::string{SYSTEM} == "aarch64-darwin") From ceabe106c8df265ba276fd11e8dd70c060736400 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Mon, 22 Nov 2021 14:42:31 -0600 Subject: [PATCH 2/2] Set new rosetta 2 path in sandbox see: https://github.com/NixOS/nix/pull/5388 and https://github.com/NixOS/nix/pull/5251 (cherry picked from commit 08b1ac3e389cda2ba0947e25ea7b09ba2df4813f) --- src/libstore/sandbox-defaults.sb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libstore/sandbox-defaults.sb b/src/libstore/sandbox-defaults.sb index 41893e6ddae..56b35c3fe6a 100644 --- a/src/libstore/sandbox-defaults.sb +++ b/src/libstore/sandbox-defaults.sb @@ -100,4 +100,5 @@ ; Allow Rosetta 2 to run x86_64 binaries on aarch64-darwin. (allow file-read* - (subpath "/Library/Apple/usr/libexec/oah")) + (subpath "/Library/Apple/usr/libexec/oah") + (subpath "/System/Library/Apple/usr/libexec/oah"))