1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 06:01:48 +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:
John Ericson 2025-03-12 16:54:39 -04:00
parent 06af9cb532
commit 99d0dd3a43

View file

@ -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