mirror of
https://github.com/NixOS/nix
synced 2025-07-07 10:11:47 +02:00
Simplify hook error status logic
The simplification here is due to a long-standing bug, but it is not worth fixing the bug at this time. Instead we've finally written up an issue for the bug, and referenced the issue number in the code.
This commit is contained in:
parent
06af9cb532
commit
99d0dd3a43
1 changed files with 2 additions and 19 deletions
|
@ -930,28 +930,11 @@ Goal::Co DerivationGoal::hookDone()
|
||||||
|
|
||||||
appendLogTailErrorMsg(worker, drvPath, logTail, msg);
|
appendLogTailErrorMsg(worker, drvPath, logTail, msg);
|
||||||
|
|
||||||
auto e = BuildError(msg);
|
|
||||||
|
|
||||||
outputLocks.unlock();
|
outputLocks.unlock();
|
||||||
|
|
||||||
BuildResult::Status st = BuildResult::MiscFailure;
|
/* TODO (once again) support fine-grained error codes, see issue #12641. */
|
||||||
|
|
||||||
#ifndef _WIN32
|
co_return done(BuildResult::MiscFailure, {}, BuildError(msg));
|
||||||
if (WIFEXITED(status) && WEXITSTATUS(status) == 101)
|
|
||||||
st = BuildResult::TimedOut;
|
|
||||||
|
|
||||||
else if (WIFEXITED(status) && WEXITSTATUS(status) == 100)
|
|
||||||
{
|
|
||||||
assert(derivationType);
|
|
||||||
st =
|
|
||||||
dynamic_cast<NotDeterministic*>(&e) ? BuildResult::NotDeterministic :
|
|
||||||
statusOk(status) ? BuildResult::OutputRejected :
|
|
||||||
!derivationType->isSandboxed() ? BuildResult::TransientFailure :
|
|
||||||
BuildResult::PermanentFailure;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
co_return done(st, {}, std::move(e));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Compute the FS closure of the outputs and register them as
|
/* Compute the FS closure of the outputs and register them as
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue