1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 21:41:48 +02:00

Improve build failure error messages

They're now laid out in a more readable way, and they shows the output
paths (if known).
This commit is contained in:
Eelco Dolstra 2025-05-09 00:32:41 +02:00
parent cdbe788c1f
commit 5a84237209
4 changed files with 54 additions and 8 deletions

View file

@ -585,10 +585,14 @@ std::variant<std::pair<BuildResult::Status, Error>, SingleDrvOutputs> Derivation
diskFull |= cleanupDecideWhetherDiskFull();
auto msg = fmt("builder for '%s' %s",
auto msg = fmt(
"Cannot build '%s'.\n"
"Reason: " ANSI_RED "builder %s" ANSI_NORMAL ".",
Magenta(store.printStorePath(drvPath)),
statusToString(status));
msg += showKnownOutputs(store, drv);
miscMethods->appendLogTailErrorMsg(msg);
if (diskFull)