mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-25 23:36:16 +02:00
Improve Rosetta detection
Turns out that one of those *.plist files can exist even if Rosetta is not installed. So let's just try to run an x86_64-darwin binary directly.
This commit is contained in:
parent
59a304a9a8
commit
96eb5ef156
1 changed files with 5 additions and 5 deletions
|
@ -154,12 +154,12 @@ 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") ||
|
||||
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")
|
||||
if (std::string{SYSTEM} == "aarch64-darwin") {
|
||||
if (runProgram(RunOptions {.program = "arch", .args = {"-arch", "x86_64", "/bin/pwd"}, .mergeStderrToStdout = true}).first == 0) {
|
||||
debug("Rosetta detected");
|
||||
extraPlatforms.insert("x86_64-darwin");
|
||||
} else
|
||||
debug("Rosetta not detected");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue