From fed3a2ce0b180519e95079319c72a2b09f99b361 Mon Sep 17 00:00:00 2001 From: Aiden Fox Ivey Date: Wed, 22 Jan 2025 23:29:39 -0500 Subject: [PATCH 1/2] Add Rosetta 2 install message --- .../unix/build/local-derivation-goal.cc | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/libstore/unix/build/local-derivation-goal.cc b/src/libstore/unix/build/local-derivation-goal.cc index ceb0b3539..2e7e81109 100644 --- a/src/libstore/unix/build/local-derivation-goal.cc +++ b/src/libstore/unix/build/local-derivation-goal.cc @@ -531,13 +531,19 @@ void LocalDerivationGoal::startBuilder() killSandbox(false); /* Right platform? */ - if (!parsedDrv->canBuildLocally(worker.store)) - throw Error("a '%s' with features {%s} is required to build '%s', but I am a '%s' with features {%s}", - drv->platform, - concatStringsSep(", ", parsedDrv->getRequiredSystemFeatures()), - worker.store.printStorePath(drvPath), - settings.thisSystem, - concatStringsSep(", ", worker.store.systemFeatures)); + if (!parsedDrv->canBuildLocally(worker.store)) { + // since aarch64-darwin has Rosetta 2, this user can actually run x86_64-darwin on their hardware - we should tell them to run the command to install Darwin 2 + if (drv->platform == "x86_64-darwin" && settings.thisSystem == "aarch64-darwin") { + throw Error("run `/usr/sbin/softwareupdate --install-rosetta --agree-to-license` to enable your %s to run programs for %s", settings.thisSystem, drv->platform); + } else { + throw Error("a '%s' with features {%s} is required to build '%s', but I am a '%s' with features {%s}", + drv->platform, + concatStringsSep(", ", parsedDrv->getRequiredSystemFeatures()), + worker.store.printStorePath(drvPath), + settings.thisSystem, + concatStringsSep(", ", worker.store.systemFeatures)); + } + } /* Create a temporary directory where the build will take place. */ From 55c1e4454ed08fa5c8cec2b3d1ed13de27a61d97 Mon Sep 17 00:00:00 2001 From: Aiden Fox Ivey Date: Mon, 10 Feb 2025 11:37:37 -0500 Subject: [PATCH 2/2] Update src/libstore/unix/build/local-derivation-goal.cc Co-authored-by: Robert Hensing --- src/libstore/unix/build/local-derivation-goal.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstore/unix/build/local-derivation-goal.cc b/src/libstore/unix/build/local-derivation-goal.cc index 2e7e81109..34b5a2f61 100644 --- a/src/libstore/unix/build/local-derivation-goal.cc +++ b/src/libstore/unix/build/local-derivation-goal.cc @@ -534,7 +534,7 @@ void LocalDerivationGoal::startBuilder() if (!parsedDrv->canBuildLocally(worker.store)) { // since aarch64-darwin has Rosetta 2, this user can actually run x86_64-darwin on their hardware - we should tell them to run the command to install Darwin 2 if (drv->platform == "x86_64-darwin" && settings.thisSystem == "aarch64-darwin") { - throw Error("run `/usr/sbin/softwareupdate --install-rosetta --agree-to-license` to enable your %s to run programs for %s", settings.thisSystem, drv->platform); + throw Error("run `/usr/sbin/softwareupdate --install-rosetta` to enable your %s to run programs for %s", settings.thisSystem, drv->platform); } else { throw Error("a '%s' with features {%s} is required to build '%s', but I am a '%s' with features {%s}", drv->platform,