Skip to content

Commit 1068b96

Browse files
authored
Merge pull request #12400 from aidenfoxivey/add-rosetta-2-info-msg
Add Rosetta 2 Info Message
2 parents 2d36679 + 55c1e44 commit 1068b96

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

src/libstore/unix/build/local-derivation-goal.cc

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -531,13 +531,19 @@ void LocalDerivationGoal::startBuilder()
531531
killSandbox(false);
532532

533533
/* Right platform? */
534-
if (!parsedDrv->canBuildLocally(worker.store))
535-
throw Error("a '%s' with features {%s} is required to build '%s', but I am a '%s' with features {%s}",
536-
drv->platform,
537-
concatStringsSep(", ", parsedDrv->getRequiredSystemFeatures()),
538-
worker.store.printStorePath(drvPath),
539-
settings.thisSystem,
540-
concatStringsSep<StringSet>(", ", worker.store.systemFeatures));
534+
if (!parsedDrv->canBuildLocally(worker.store)) {
535+
// 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
536+
if (drv->platform == "x86_64-darwin" && settings.thisSystem == "aarch64-darwin") {
537+
throw Error("run `/usr/sbin/softwareupdate --install-rosetta` to enable your %s to run programs for %s", settings.thisSystem, drv->platform);
538+
} else {
539+
throw Error("a '%s' with features {%s} is required to build '%s', but I am a '%s' with features {%s}",
540+
drv->platform,
541+
concatStringsSep(", ", parsedDrv->getRequiredSystemFeatures()),
542+
worker.store.printStorePath(drvPath),
543+
settings.thisSystem,
544+
concatStringsSep<StringSet>(", ", worker.store.systemFeatures));
545+
}
546+
}
541547

542548
/* Create a temporary directory where the build will take
543549
place. */

0 commit comments

Comments
 (0)