1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 22:01:15 +02:00

Add Rosetta 2 install message

This commit is contained in:
Aiden Fox Ivey 2025-01-22 23:29:39 -05:00
parent 06123f6284
commit fed3a2ce0b
No known key found for this signature in database

View file

@ -531,13 +531,19 @@ void LocalDerivationGoal::startBuilder()
killSandbox(false); killSandbox(false);
/* Right platform? */ /* Right platform? */
if (!parsedDrv->canBuildLocally(worker.store)) 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}", // 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
drv->platform, if (drv->platform == "x86_64-darwin" && settings.thisSystem == "aarch64-darwin") {
concatStringsSep(", ", parsedDrv->getRequiredSystemFeatures()), throw Error("run `/usr/sbin/softwareupdate --install-rosetta --agree-to-license` to enable your %s to run programs for %s", settings.thisSystem, drv->platform);
worker.store.printStorePath(drvPath), } else {
settings.thisSystem, throw Error("a '%s' with features {%s} is required to build '%s', but I am a '%s' with features {%s}",
concatStringsSep<StringSet>(", ", worker.store.systemFeatures)); drv->platform,
concatStringsSep(", ", parsedDrv->getRequiredSystemFeatures()),
worker.store.printStorePath(drvPath),
settings.thisSystem,
concatStringsSep<StringSet>(", ", worker.store.systemFeatures));
}
}
/* Create a temporary directory where the build will take /* Create a temporary directory where the build will take
place. */ place. */