aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-10-14 17:35:57 +0200
committerGitHub <noreply@github.com>2022-10-14 17:35:57 +0200
commit3093bd3a855b8fa1f572fd5a33c1971adf5e3e08 (patch)
tree710c0b03d78ed4d3360bc80763eedcf8520a2a43
parent9f7877abacbf3f0371b3b0969f7380c6c6db58a5 (diff)
parent285277a61af8d7ad49f2155166690601aa1a59a9 (diff)
Merge pull request #7168 from NixOS/rosetta-test
Improve Rosetta detection
-rw-r--r--src/libcmd/repl.cc2
-rw-r--r--src/libmain/progress-bar.cc2
-rw-r--r--src/libstore/globals.cc10
3 files changed, 5 insertions, 9 deletions
diff --git a/src/libcmd/repl.cc b/src/libcmd/repl.cc
index 61c05050f..df8932087 100644
--- a/src/libcmd/repl.cc
+++ b/src/libcmd/repl.cc
@@ -1050,7 +1050,7 @@ struct CmdRepl : InstallablesCommand
evalSettings.pureEval = false;
}
- void prepare()
+ void prepare() override
{
if (!settings.isExperimentalFeatureEnabled(Xp::ReplFlake) && !(file) && this->_installables.size() >= 1) {
warn("future versions of Nix will require using `--file` to load a file");
diff --git a/src/libmain/progress-bar.cc b/src/libmain/progress-bar.cc
index 0bbeaff8d..961f4e18a 100644
--- a/src/libmain/progress-bar.cc
+++ b/src/libmain/progress-bar.cc
@@ -503,7 +503,7 @@ public:
return s[0];
}
- virtual void setPrintBuildLogs(bool printBuildLogs)
+ void setPrintBuildLogs(bool printBuildLogs) override
{
this->printBuildLogs = printBuildLogs;
}
diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc
index d724897bb..ff658c428 100644
--- a/src/libstore/globals.cc
+++ b/src/libstore/globals.cc
@@ -154,13 +154,9 @@ 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")
- extraPlatforms.insert("x86_64-darwin");
- }
+ if (std::string{SYSTEM} == "aarch64-darwin" &&
+ runProgram(RunOptions {.program = "arch", .args = {"-arch", "x86_64", "/usr/bin/true"}, .mergeStderrToStdout = true}).first == 0)
+ extraPlatforms.insert("x86_64-darwin");
#endif
return extraPlatforms;