Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/libstore/unix/build/derivation-builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand All @@ -885,6 +886,24 @@ void DerivationBuilderImpl::startBuilder()
settings.thisSystem,
concatStringsSep<StringSet>(", ", 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<StringSet>(", ", 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
Expand Down
Loading