mirror of
https://github.com/NixOS/nix.git
synced 2025-11-16 07:22:43 +01:00
Merge pull request #13862 from obsidiansystems/build-failure-content-vs-presentation
Properly separater builder failure content and presentation
This commit is contained in:
commit
0d300112fa
4 changed files with 48 additions and 34 deletions
|
|
@ -535,26 +535,16 @@ SingleDrvOutputs DerivationBuilderImpl::unprepareBuild()
|
|||
/* Check the exit status. */
|
||||
if (!statusOk(status)) {
|
||||
|
||||
/* Check *before* cleaning up. */
|
||||
bool diskFull = decideWhetherDiskFull();
|
||||
|
||||
cleanupBuild(false);
|
||||
|
||||
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)
|
||||
msg += "\nnote: build failure may have been caused by lack of free disk space";
|
||||
|
||||
throw BuildError(
|
||||
throw BuilderFailureError{
|
||||
!derivationType.isSandboxed() || diskFull ? BuildResult::TransientFailure : BuildResult::PermanentFailure,
|
||||
msg);
|
||||
status,
|
||||
diskFull ? "\nnote: build failure may have been caused by lack of free disk space" : "",
|
||||
};
|
||||
}
|
||||
|
||||
/* Compute the FS closure of the outputs and register them as
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue