Skip to content

Commit 99d0dd3

Browse files
committed
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.
1 parent 06af9cb commit 99d0dd3

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

src/libstore/build/derivation-goal.cc

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -930,28 +930,11 @@ Goal::Co DerivationGoal::hookDone()
930930

931931
appendLogTailErrorMsg(worker, drvPath, logTail, msg);
932932

933-
auto e = BuildError(msg);
934-
935933
outputLocks.unlock();
936934

937-
BuildResult::Status st = BuildResult::MiscFailure;
938-
939-
#ifndef _WIN32
940-
if (WIFEXITED(status) && WEXITSTATUS(status) == 101)
941-
st = BuildResult::TimedOut;
942-
943-
else if (WIFEXITED(status) && WEXITSTATUS(status) == 100)
944-
{
945-
assert(derivationType);
946-
st =
947-
dynamic_cast<NotDeterministic*>(&e) ? BuildResult::NotDeterministic :
948-
statusOk(status) ? BuildResult::OutputRejected :
949-
!derivationType->isSandboxed() ? BuildResult::TransientFailure :
950-
BuildResult::PermanentFailure;
951-
}
952-
#endif
935+
/* TODO (once again) support fine-grained error codes, see issue #12641. */
953936

954-
co_return done(st, {}, std::move(e));
937+
co_return done(BuildResult::MiscFailure, {}, BuildError(msg));
955938
}
956939

957940
/* Compute the FS closure of the outputs and register them as

0 commit comments

Comments
 (0)