diff --git a/src/libstore/unix/build/derivation-builder.cc b/src/libstore/unix/build/derivation-builder.cc index 85d8a8f29e3..d34f408980d 100644 --- a/src/libstore/unix/build/derivation-builder.cc +++ b/src/libstore/unix/build/derivation-builder.cc @@ -869,6 +869,7 @@ void DerivationBuilderImpl::startBuilder() /* Right platform? */ if (!drvOptions.canBuildLocally(store, drv)) { +<<<<<<< HEAD // 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") { @@ -885,6 +886,24 @@ void DerivationBuilderImpl::startBuilder() settings.thisSystem, concatStringsSep(", ", store.config.systemFeatures)); } +======= + auto msg = fmt( + "Cannot build '%s'.\n" + "Reason: " ANSI_RED "required system or feature not available" ANSI_NORMAL "\n" + "Required system: '%s' with features {%s}\n" + "Current system: '%s' with features {%s}", + Magenta(store.printStorePath(drvPath)), + Magenta(drv.platform), + concatStringsSep(", ", drvOptions.getRequiredSystemFeatures(drv)), + Magenta(settings.thisSystem), + concatStringsSep(", ", store.config.systemFeatures)); + + // 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") + msg += fmt("\nNote: run `%s` to run programs for x86_64-darwin", Magenta("/usr/sbin/softwareupdate --install-rosetta")); + + throw BuildError(msg); +>>>>>>> b04962b33 (Make platform checks throw BuildError like other failures) } /* Create a temporary directory where the build will take