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

Merge pull request #12400 from aidenfoxivey/add-rosetta-2-info-msg

Add Rosetta 2 Info Message
This commit is contained in:
Robert Hensing 2025-02-15 17:47:04 +01:00 committed by GitHub
commit 1068b9657f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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` 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. */